Image decoding method and device using residual information in image coding system

ABSTRACT

An image decoding method includes receiving residual information including first size related information for a first residual coefficient and second size related information for a second residual coefficient, setting a Rice parameter of the first size related information and the second size related information as a specific value, deriving available binary values based on the Rice parameter, deriving binary values of the first size related information and the second size related information by decoding the first size related information and the second size related information, deriving values of the first size related information and the second size related information by comparing the binary values and the available binary values, deriving the first residual coefficient and the second residual coefficient based on the values, and reconstructing a current picture based on the first residual coefficient and the second residual coefficient.

CROSS-REFERENCE TO RELATED APPLICATIONS

Pursuant to 35 U.S.C. § 119(e), this application claims the benefit ofU.S. Provisional Application No. 62/744,623 filed on Oct. 11, 2018, thecontents of which are all hereby incorporated by reference herein intheir entirety.

BACKGROUND OF THE DISCLOSURE Field of the disclosure

The present disclosure relates to an image coding technique, and moreparticularly, to an image decoding method and apparatus therefor usingresidual information in an image coding system.

Related Art

Demand for high-resolution, high-quality images such as HD (HighDefinition) images and UHD (Ultra High Definition) images have beenincreasing in various fields. As the image data has high resolution andhigh quality, the amount of information or bits to be transmittedincreases relative to the legacy image data. Therefore, when image datais transmitted using a medium such as a conventional wired/wirelessbroadband line or image data is stored using an existing storage medium,the transmission cost and the storage cost thereof are increased.

Accordingly, there is a need for a highly efficient image compressiontechnique for effectively transmitting, storing, and reproducinginformation of high resolution and high quality images.

SUMMARY

The present disclosure provides a method and apparatus for improvingimage coding efficiency.

The present disclosure also provides a method and apparatus forimproving efficiency of residual coding.

The present disclosure also provides a method and apparatus for derivinga Rice parameter which is used for binarizing information for acoefficient in residual information.

According to an embodiment of the present disclosure, it is provided animage decoding method performed by a decoding apparatus. The methodincludes receiving residual information including first size relatedinformation for a first residual coefficient and second size relatedinformation for a second residual coefficient of a current block,setting a Rice parameter of the first size related information and thesecond size related information as a specific value, deriving availablebinary values for the first size related information and the second sizerelated information based on the Rice parameter, deriving a binary valueof the first size related information and a binary value of the secondsize related information by decoding the first size related informationand the second size related information, deriving values of the firstsize related information and the second size related information bycomparing the binary values and the available binary values, derivingthe first residual coefficient and the second residual coefficient basedon the values of the first size related information and the second sizerelated information, and reconstructing a current picture based on thefirst residual coefficient and the second residual coefficient.

According to another embodiment of the present disclosure, it isprovided a decoding apparatus performing an image decoding. The decodingapparatus includes an entropy encoder for receiving residual informationincluding first size related information for a first residualcoefficient and second size related information for a second residualcoefficient of a current block, setting a Rice parameter of the firstsize related information and the second size related information as aspecific value, deriving available binary values for the first sizerelated information and the second size related information based on theRice parameter, deriving a binary value of the first size relatedinformation and a binary value of the second size related information bydecoding the first size related information and the second size relatedinformation, deriving values of the first size related information andthe second size related information by comparing the binary values andthe available binary values, deriving the first residual coefficient andthe second residual coefficient based on the values of the first sizerelated information and the second size related information, and anadder for reconstructing a current picture based on the first residualcoefficient and the second residual coefficient.

According to still another embodiment of the present disclosure, it isprovided a video encoding method performed by an encoding apparatus. Themethod includes deriving a first residual coefficient and a secondresidual coefficient of a current block, setting a Rice parameter forthe first residual coefficient and the second residual coefficient as aspecific value, deriving binary values for first size relatedinformation for the first residual coefficient and second size relatedinformation for the second residual coefficient based on the Riceparameter, and generating residual information including the first sizerelated information and the second size related information by encodingthe binary values for first size related information for the firstresidual coefficient and second size related information.

According to still another embodiment of the present disclosure, it isprovided a video encoding apparatus. The encoding apparatus includes aquantizer for deriving a first residual coefficient and a secondresidual coefficient of a current block, and an entropy encoder forsetting a Rice parameter for the first residual coefficient and thesecond residual coefficient as a specific value, deriving binary valuesfor first size related information for the first residual coefficientand second size related information for the second residual coefficientbased on the Rice parameter, and generating residual informationincluding the first size related information and the second size relatedinformation by encoding the binary values for first size relatedinformation for the first residual coefficient and second size relatedinformation.

According to the present disclosure, the overall image/video compressionefficiency may be improved.

According to the present disclosure, the efficiency of residual codingmay be improved.

According to the present disclosure, by considering that there is littlecorrelation among residual coefficients of a pixel domain in whichtransform process is not performed, the process of deriving a riceparameter for binarizing residual coefficients may be simplified, andthrough this, residual coding efficiency may be improved.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 briefly illustrates a video/image coding system to which theembodiments of the present disclosure is applicable.

FIG. 2 is a schematic diagram illustrating a configuration of avideo/image encoding apparatus to which the embodiment(s) of the presentdisclosure is applicable.

FIG. 3 is a schematic diagram illustrating a configuration of avideo/image decoding apparatus to which the embodiment(s) of the presentdisclosure is applicable.

FIG. 4 illustrates the context-adaptive binary arithmetic coding (CABAC)for encoding a syntax element.

FIG. 5 is a diagram illustrating examples of transform coefficients in a4×4 block.

FIG. 6 illustrates a decoding apparatus for performing a method fortransferring a residual signal of a pixel domain which is proposed.

FIGS. 7a and 7b illustrate the proposed embodiment of deriving the Riceparameter and a Rice parameter deriver performing the embodiment.

FIG. 8 illustrates a Rice parameter deriver performing the embodiment.

FIG. 9 illustrates a residual encoding method performed by the encodingapparatus.

FIG. 10 illustrates the entropy encoder 240 of the encoding apparatusperforming the residual encoding method.

FIG. 11 illustrates a residual decoding method performed by the decodingapparatus.

FIG. 12 illustrates the entropy decoder 310 of the decoding apparatusperforming the residual decoding method.

FIG. 13 illustrates an image encoding method by the encoding apparatusaccording to the present disclosure.

FIG. 14 schematically illustrates the encoding apparatus performing theimage encoding method according to the present disclosure.

FIG. 15 schematically illustrates the image decoding method of thedecoding apparatus according to the present disclosure.

FIG. 16 schematically illustrates the decoding apparatus performing theimage decoding method according to the present disclosure.

FIG. 17 illustrates a structure diagram of a content streaming system towhich the embodiments of the present disclosure are applied.

DESCRIPTION OF EXEMPLARY EMBODIMENTS

The present disclosure may be modified in various forms, and specificembodiments thereof will be described and illustrated in the drawings.However, the embodiments are not intended for limiting the disclosure.The terms used in the following description are used to merely describespecific embodiments but are not intended to limit the disclosure. Anexpression of a singular number includes an expression of the pluralnumber, so long as it is clearly read differently. The terms such as“include” and “have” are intended to indicate that features, numbers,steps, operations, elements, components, or combinations thereof used inthe following description exist and it should be thus understood thatthe possibility of existence or addition of one or more differentfeatures, numbers, steps, operations, elements, components, orcombinations thereof is not excluded.

Meanwhile, elements in the drawings described in the disclosure areindependently drawn for the purpose of convenience for explanation ofdifferent specific functions, and do not mean that the elements areembodied by independent hardware or independent software. For example,two or more elements of the elements may be combined to form a singleelement, or one element may be divided into plural elements. Theembodiments in which the elements are combined and/or divided belong tothe disclosure without departing from the concept of the disclosure.

Hereinafter, embodiments of the present disclosure will be described indetail with reference to the accompanying drawings. In addition, likereference numerals are used to indicate like elements throughout thedrawings, and the same descriptions on the like elements will beomitted.

FIG. 1 briefly illustrates a video/image coding system to which theembodiments of the present disclosure is applicable.

Referring to FIG. 1, a video/image coding system may include a firstdevice (source device) and a second device (receiving device). Thesource device may deliver encoded video/image information or data in theform of a file or streaming to the receiving device via a digitalstorage medium or network.

The source device may include a video source, an encoding apparatus, anda transmitter. The receiving device may include a receiver, a decodingapparatus, and a renderer. The encoding apparatus may be called avideo/image encoding apparatus, and the decoding apparatus may be calleda video/image decoding apparatus. The transmitter may be included in theencoding apparatus. The receiver may be included in the decodingapparatus. The renderer may include a display, and the display may beconfigured as a separate device or an external component.

The video source may acquire video/image through a process of capturing,synthesizing, or generating the video/image. The video source mayinclude a video/image capture device and/or a video/image generatingdevice. The video/image capture device may include, for example, one ormore cameras, video/image archives including previously capturedvideo/images, and the like. The video/image generating device mayinclude, for example, computers, tablets and smartphones, and may(electronically) generate video/images. For example, a virtualvideo/image may be generated through a computer or the like. In thiscase, the video/image capturing process may be replaced by a process ofgenerating related data.

The encoding apparatus may encode input video/image. The encodingapparatus may perform a series of procedures such as prediction,transform, and quantization for compression and coding efficiency. Theencoded data (encoded video/image information) may be output in the formof a bitstream.

The transmitter may transmit the encoded image/image information or dataoutput in the form of a bitstream to the receiver of the receivingdevice through a digital storage medium or a network in the form of afile or streaming. The digital storage medium may include variousstorage mediums such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, and thelike. The transmitter may include an element for generating a media filethrough a predetermined file format and may include an element fortransmission through a broadcast/communication network. The receiver mayreceive/extract the bitstream and transmit the received bitstream to thedecoding apparatus.

The decoding apparatus may decode the video/image by performing a seriesof procedures such as dequantization, inverse transform, and predictioncorresponding to the operation of the encoding apparatus.

The renderer may render the decoded video/image. The renderedvideo/image may be displayed through the display.

This document relates to video/image coding. For example, themethods/embodiments disclosed in this document may be applied to amethod disclosed in the versatile video coding (VVC), the EVC (essentialvideo coding) standard, the AOMedia Video 1 (AV1) standard, the 2ndgeneration of audio video coding standard (AVS2), or the next generationvideo/image coding standard (ex. H.267 or H.268, etc.).

This document presents various embodiments of video/image coding, andthe embodiments may be performed in combination with each other unlessotherwise mentioned.

In this document, video may refer to a series of images over time.Picture generally refers to a unit representing one image in a specifictime zone, and a slice/tile is a unit constituting part of a picture incoding. The slice/tile may include one or more coding tree units (CTUs).One picture may consist of one or more slices/tiles. One picture mayconsist of one or more tile groups. One tile group may include one ormore tiles. A brick may represent a rectangular region of CTU rowswithin a tile in a picture. A tile may be partitioned into multiplebricks, each of which consisting of one or more CTU rows within thetile. A tile that is not partitioned into multiple bricks may be alsoreferred to as a brick. A brick scan is a specific sequential orderingof CTUs partitioning a picture in which the CTUs are orderedconsecutively in CTU raster scan in a brick, bricks within a tile areordered consecutively in a raster scan of the bricks of the tile, andtiles in a picture are ordered consecutively in a raster scan of thetiles of the picture. A tile is a rectangular region of CTUs within aparticular tile column and a particular tile row in a picture. The tilecolumn is a rectangular region of CTUs having a height equal to theheight of the picture and a width specified by syntax elements in thepicture parameter set. The tile row is a rectangular region of CTUshaving a height specified by syntax elements in the picture parameterset and a width equal to the width of the picture. A tile scan is aspecific sequential ordering of CTUs partitioning a picture in which theCTUs are ordered consecutively in CTU raster scan in a tile whereastiles in a picture are ordered consecutively in a raster scan of thetiles of the picture. A slice includes an integer number of bricks of apicture that may be exclusively contained in a single NAL unit. A slicemay consists of either a number of complete tiles or only a consecutivesequence of complete bricks of one tile. Tile groups and slices may beused interchangeably in this document. For example, in this document, atile group/tile group header may be called a slice/slice header.

A pixel or a pel may mean a smallest unit constituting one picture (orimage). Also, ‘sample’ may be used as a term corresponding to a pixel. Asample may generally represent a pixel or a value of a pixel, and mayrepresent only a pixel/pixel value of a luma component or only apixel/pixel value of a chroma component.

A unit may represent a basic unit of image processing. The unit mayinclude at least one of a specific region of the picture and informationrelated to the region. One unit may include one luma block and twochroma (ex. cb, cr) blocks. The unit may be used interchangeably withterms such as block or area in some cases. In a general case, an M×Nblock may include samples (or sample arrays) or a set (or array) oftransform coefficients of M columns and N rows.

In this document, the term “/” and “,” should be interpreted to indicate“and/or.” For instance, the expression “A/B” may mean “A and/or B.”Further, “A, B” may mean “A and/or B.” Further, “A/B/C” may mean “atleast one of A, B, and/or C.” Also, “A/B/C” may mean “at least one of A,B, and/or C.”

Further, in the document, the term “or” should be interpreted toindicate “and/or.” For instance, the expression “A or B” may comprise 1)only A, 2) only B, and/or 3) both A and B. In other words, the term “or”in this document should be interpreted to indicate “additionally oralternatively.”

FIG. 2 is a schematic diagram illustrating a configuration of avideo/image encoding apparatus to which the embodiment(s) of the presentdocument may be applied. Hereinafter, the video encoding apparatus mayinclude an image encoding apparatus.

Referring to FIG. 2, the encoding apparatus 200 includes an imagepartitioner 210, a predictor 220, a residual processor 230, and anentropy encoder 240, an adder 250, a filter 260, and a memory 270. Thepredictor 220 may include an inter predictor 221 and an intra predictor222. The residual processor 230 may include a transformer 232, aquantizer 233, a dequantizer 234, and an inverse transformer 235. Theresidual processor 230 may further include a subtractor 231. The adder250 may be called a reconstructor or a reconstructed block generator.The image partitioner 210, the predictor 220, the residual processor230, the entropy encoder 240, the adder 250, and the filter 260 may beconfigured by at least one hardware component (ex. an encoder chipset orprocessor) according to an embodiment. In addition, the memory 270 mayinclude a decoded picture buffer (DPB) or may be configured by a digitalstorage medium. The hardware component may further include the memory270 as an internal/external component.

The image partitioner 210 may partition an input image (or a picture ora frame) input to the encoding apparatus 200 into one or moreprocessors. For example, the processor may be called a coding unit (CU).In this case, the coding unit may be recursively partitioned accordingto a quad-tree binary-tree ternary-tree (QTBTTT) structure from a codingtree unit (CTU) or a largest coding unit (LCU). For example, one codingunit may be partitioned into a plurality of coding units of a deeperdepth based on a quad tree structure, a binary tree structure, and/or aternary structure. In this case, for example, the quad tree structuremay be applied first and the binary tree structure and/or ternarystructure may be applied later. Alternatively, the binary tree structuremay be applied first. The coding procedure according to this documentmay be performed based on the final coding unit that is no longerpartitioned. In this case, the largest coding unit may be used as thefinal coding unit based on coding efficiency according to imagecharacteristics, or if necessary, the coding unit may be recursivelypartitioned into coding units of deeper depth and a coding unit havingan optimal size may be used as the final coding unit. Here, the codingprocedure may include a procedure of prediction, transform, andreconstruction, which will be described later. As another example, theprocessor may further include a prediction unit (PU) or a transform unit(TU). In this case, the prediction unit and the transform unit may besplit or partitioned from the aforementioned final coding unit. Theprediction unit may be a unit of sample prediction, and the transformunit may be a unit for deriving a transform coefficient and/or a unitfor deriving a residual signal from the transform coefficient.

The unit may be used interchangeably with terms such as block or area insome cases. In a general case, an M×N block may represent a set ofsamples or transform coefficients composed of M columns and N rows. Asample may generally represent a pixel or a value of a pixel, mayrepresent only a pixel/pixel value of a luma component or represent onlya pixel/pixel value of a chroma component. A sample may be used as aterm corresponding to one picture (or image) for a pixel or a pel.

In the encoding apparatus 200, a prediction signal (predicted block,prediction sample array) output from the inter predictor 221 or theintra predictor 222 is subtracted from an input image signal (originalblock, original sample array) to generate a residual signal residualblock, residual sample array), and the generated residual signal istransmitted to the transformer 232. In this case, as shown, a unit forsubtracting a prediction signal (predicted block, prediction samplearray) from the input image signal (original block, original samplearray) in the encoder 200 may be called a subtractor 231. The predictormay perform prediction on a block to be processed (hereinafter, referredto as a current block) and generate a predicted block includingprediction samples for the current block. The predictor may determinewhether intra prediction or inter prediction is applied on a currentblock or CU basis. As described later in the description of eachprediction mode, the predictor may generate various information relatedto prediction, such as prediction mode information, and transmit thegenerated information to the entropy encoder 240. The information on theprediction may be encoded in the entropy encoder 240 and output in theform of a bitstream.

The intra predictor 222 may predict the current block by referring tothe samples in the current picture. The referred samples may be locatedin the neighborhood of the current block or may be located apartaccording to the prediction mode. In the intra prediction, predictionmodes may include a plurality of non-directional modes and a pluralityof directional modes. The non-directional mode may include, for example,a DC mode and a planar mode. The directional mode may include, forexample, 33 directional prediction modes or 65 directional predictionmodes according to the degree of detail of the prediction direction.However, this is merely an example, more or less directional predictionmodes may be used depending on a setting. The intra predictor 222 maydetermine the prediction mode applied to the current block by using aprediction mode applied to a neighboring block.

The inter predictor 221 may derive a predicted block for the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. Here, in order to reduce theamount of motion information transmitted in the inter prediction mode,the motion information may be predicted in units of blocks, subblocks,or samples based on correlation of motion information between theneighboring block and the current block. The motion information mayinclude a motion vector and a reference picture index. The motioninformation may further include inter prediction direction (L0prediction, L1 prediction, Bi prediction, etc.) information. In the caseof inter prediction, the neighboring block may include a spatialneighboring block present in the current picture and a temporalneighboring block present in the reference picture. The referencepicture including the reference block and the reference pictureincluding the temporal neighboring block may be the same or different.The temporal neighboring block may be called a collocated referenceblock, a co-located CU (colCU), and the like, and the reference pictureincluding the temporal neighboring block may be called a collocatedpicture (colPic). For example, the inter predictor 221 may configure amotion information candidate list based on neighboring blocks andgenerate information indicating which candidate is used to derive amotion vector and/or a reference picture index of the current block.Inter prediction may be performed based on various prediction modes. Forexample, in the case of a skip mode and a merge mode, the interpredictor 221 may use motion information of the neighboring block asmotion information of the current block. In the skip mode, unlike themerge mode, the residual signal may not be transmitted. In the case ofthe motion vector prediction (MVP) mode, the motion vector of theneighboring block may be used as a motion vector predictor and themotion vector of the current block may be indicated by signaling amotion vector difference.

The predictor 220 may generate a prediction signal based on variousprediction methods described below. For example, the predictor may notonly apply intra prediction or inter prediction to predict one block butalso simultaneously apply both intra prediction and inter prediction.This may be called combined inter and intra prediction (CIIP). Inaddition, the predictor may be based on an intra block copy (IBC)prediction mode or a palette mode for prediction of a block. The IBCprediction mode or palette mode may be used for content image/videocoding of a game or the like, for example, screen content coding (SCC).The IBC basically performs prediction in the current picture but may beperformed similarly to inter prediction in that a reference block isderived in the current picture. That is, the IBC may use at least one ofthe inter prediction techniques described in this document. The palettemode may be considered as an example of intra coding or intraprediction. When the palette mode is applied, a sample value within apicture may be signaled based on information on the palette table andthe palette index.

The prediction signal generated by the predictor (including the interpredictor 221 and/or the intra predictor 222) may be used to generate areconstructed signal or to generate a residual signal. The transformer232 may generate transform coefficients by applying a transformtechnique to the residual signal. For example, the transform techniquemay include at least one of a discrete cosine transform (DCT), adiscrete sine transform (DST), a karhunen-loève transform (KLT), agraph-based transform (GBT), or a conditionally non-linear transform(CNT). Here, the GBT means transform obtained from a graph whenrelationship information between pixels is represented by the graph. TheCNT refers to transform generated based on a prediction signal generatedusing all previously reconstructed pixels. In addition, the transformprocess may be applied to square pixel blocks having the same size ormay be applied to blocks having a variable size rather than square.

The quantizer 233 may quantize the transform coefficients and transmitthem to the entropy encoder 240 and the entropy encoder 240 may encodethe quantized signal (information on the quantized transformcoefficients) and output a bitstream. The information on the quantizedtransform coefficients may be referred to as residual information. Thequantizer 233 may rearrange block type quantized transform coefficientsinto a one-dimensional vector form based on a coefficient scanning orderand generate information on the quantized transform coefficients basedon the quantized transform coefficients in the one-dimensional vectorform. Information on transform coefficients may be generated. Theentropy encoder 240 may perform various encoding methods such as, forexample, exponential Golomb, context-adaptive variable length coding(CAVLC), context-adaptive binary arithmetic coding (CABAC), and thelike. The entropy encoder 240 may encode information necessary forvideo/image reconstruction other than quantized transform coefficients(ex. values of syntax elements, etc.) together or separately. Encodedinformation (ex. encoded video/image information) may be transmitted orstored in units of NALs (network abstraction layer) in the form of abitstream. The video/image information may further include informationon various parameter sets such as an adaptation parameter set (APS), apicture parameter set (PPS), a sequence parameter set (SPS), or a videoparameter set (VPS). In addition, the video/image information mayfurther include general constraint information. In this document,information and/or syntax elements transmitted/signaled from theencoding apparatus to the decoding apparatus may be included invideo/picture information. The video/image information may be encodedthrough the above-described encoding procedure and included in thebitstream. The bitstream may be transmitted over a network or may bestored in a digital storage medium. The network may include abroadcasting network and/or a communication network, and the digitalstorage medium may include various storage media such as USB, SD, CD,DVD, Blu-ray, HDD, SSD, and the like. A transmitter (not shown)transmitting a signal output from the entropy encoder 240 and/or astorage unit (not shown) storing the signal may be included asinternal/external element of the encoding apparatus 200, andalternatively, the transmitter may be included in the entropy encoder240.

The quantized transform coefficients output from the quantizer 233 maybe used to generate a prediction signal. For example, the residualsignal (residual block or residual samples) may be reconstructed byapplying dequantization and inverse transform to the quantized transformcoefficients through the dequantizer 234 and the inverse transformer235. The adder 250 adds the reconstructed residual signal to theprediction signal output from the inter predictor 221 or the intrapredictor 222 to generate a reconstructed signal (reconstructed picture,reconstructed block, reconstructed sample array). If there is noresidual for the block to be processed, such as a case where the skipmode is applied, the predicted block may be used as the reconstructedblock. The adder 250 may be called a reconstructor or a reconstructedblock generator. The generated reconstructed signal may be used forintra prediction of a next block to be processed in the current pictureand may be used for inter prediction of a next picture through filteringas described below.

Meanwhile, luma mapping with chroma scaling (LMCS) may be applied duringpicture encoding and/or reconstruction.

The filter 260 may improve subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter260 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture and store the modifiedreconstructed picture in the memory 270, specifically, a DPB of thememory 270. The various filtering methods may include, for example,deblocking filtering, a sample adaptive offset, an adaptive loop filter,a bilateral filter, and the like. The filter 260 may generate variousinformation related to the filtering and transmit the generatedinformation to the entropy encoder 240 as described later in thedescription of each filtering method. The information related to thefiltering may be encoded by the entropy encoder 240 and output in theform of a bitstream.

The modified reconstructed picture transmitted to the memory 270 may beused as the reference picture in the inter predictor 221. When the interprediction is applied through the encoding apparatus, predictionmismatch between the encoding apparatus 200 and the decoding apparatusmay be avoided and encoding efficiency may be improved.

The DPB of the memory 270 DPB may store the modified reconstructedpicture for use as a reference picture in the inter predictor 221. Thememory 270 may store the motion information of the block from which themotion information in the current picture is derived (or encoded) and/orthe motion information of the blocks in the picture that have alreadybeen reconstructed. The stored motion information may be transmitted tothe inter predictor 221 and used as the motion information of thespatial neighboring block or the motion information of the temporalneighboring block. The memory 270 may store reconstructed samples ofreconstructed blocks in the current picture and may transfer thereconstructed samples to the intra predictor 222.

FIG. 3 is a schematic diagram illustrating a configuration of avideo/image decoding apparatus to which the embodiment(s) of the presentdocument may be applied.

Referring to FIG. 3, the decoding apparatus 300 may include an entropydecoder 310, a residual processor 320, a predictor 330, an adder 340, afilter 350, a memory 360. The predictor 330 may include an interpredictor 331 and an intra predictor 332. The residual processor 320 mayinclude a dequantizer 321 and an inverse transformer 321. The entropydecoder 310, the residual processor 320, the predictor 330, the adder340, and the filter 350 may be configured by a hardware component (ex. adecoder chipset or a processor) according to an embodiment. In addition,the memory 360 may include a decoded picture buffer (DPB) or may beconfigured by a digital storage medium. The hardware component mayfurther include the memory 360 as an internal/external component.

When a bitstream including video/image information is input, thedecoding apparatus 300 may reconstruct an image corresponding to aprocess in which the video/image information is processed in theencoding apparatus of FIG. 2. For example, the decoding apparatus 300may derive units/blocks based on block partition related informationobtained from the bitstream. The decoding apparatus 300 may performdecoding using a processor applied in the encoding apparatus. Thus, theprocessor of decoding may be a coding unit, for example, and the codingunit may be partitioned according to a quad tree structure, binary treestructure and/or ternary tree structure from the coding tree unit or thelargest coding unit. One or more transform units may be derived from thecoding unit. The reconstructed image signal decoded and output throughthe decoding apparatus 300 may be reproduced through a reproducingapparatus.

The decoding apparatus 300 may receive a signal output from the encodingapparatus of FIG. 2 in the form of a bitstream, and the received signalmay be decoded through the entropy decoder 310. For example, the entropydecoder 310 may parse the bitstream to derive information (ex.video/image information) necessary for image reconstruction (or picturereconstruction). The video/image information may further includeinformation on various parameter sets such as an adaptation parameterset (APS), a picture parameter set (PPS), a sequence parameter set(SPS), or a video parameter set (VPS). In addition, the video/imageinformation may further include general constraint information. Thedecoding apparatus may further decode picture based on the informationon the parameter set and/or the general constraint information.Signaled/received information and/or syntax elements described later inthis document may be decoded may decode the decoding procedure andobtained from the bitstream. For example, the entropy decoder 310decodes the information in the bitstream based on a coding method suchas exponential Golomb coding, CAVLC, or CABAC, and output syntaxelements required for image reconstruction and quantized values oftransform coefficients for residual. More specifically, the CABACentropy decoding method may receive a bin corresponding to each syntaxelement in the bitstream, determine a context model using a decodingtarget syntax element information, decoding information of a decodingtarget block or information of a symbol/bin decoded in a previous stage,and perform an arithmetic decoding on the bin by predicting aprobability of occurrence of a bin according to the determined contextmodel, and generate a symbol corresponding to the value of each syntaxelement. In this case, the CABAC entropy decoding method may update thecontext model by using the information of the decoded symbol/bin for acontext model of a next symbol/bin after determining the context model.The information related to the prediction among the information decodedby the entropy decoder 310 may be provided to the predictor (the interpredictor 332 and the intra predictor 331), and the residual value onwhich the entropy decoding was performed in the entropy decoder 310,that is, the quantized transform coefficients and related parameterinformation, may be input to the residual processor 320. The residualprocessor 320 may derive the residual signal (the residual block, theresidual samples, the residual sample array). In addition, informationon filtering among information decoded by the entropy decoder 310 may beprovided to the filter 350. Meanwhile, a receiver (not shown) forreceiving a signal output from the encoding apparatus may be furtherconfigured as an internal/external element of the decoding apparatus300, or the receiver may be a component of the entropy decoder 310.Meanwhile, the decoding apparatus according to this document may bereferred to as a video/image/picture decoding apparatus, and thedecoding apparatus may be classified into an information decoder(video/image/picture information decoder) and a sample decoder(video/image/picture sample decoder). The information decoder mayinclude the entropy decoder 310, and the sample decoder may include atleast one of the dequantizer 321, the inverse transformer 322, the adder340, the filter 350, the memory 360, the inter predictor 332, and theintra predictor 331.

The dequantizer 321 may dequantize the quantized transform coefficientsand output the transform coefficients. The dequantizer 321 may rearrangethe quantized transform coefficients in the form of a two-dimensionalblock form. In this case, the rearrangement may be performed based onthe coefficient scanning order performed in the encoding apparatus. Thedequantizer 321 may perform dequantization on the quantized transformcoefficients by using a quantization parameter (ex. quantization stepsize information) and obtain transform coefficients.

The inverse transformer 322 inversely transforms the transformcoefficients to obtain a residual signal (residual block, residualsample array).

The predictor may perform prediction on the current block and generate apredicted block including prediction samples for the current block. Thepredictor may determine whether intra prediction or inter prediction isapplied to the current block based on the information on the predictionoutput from the entropy decoder 310 and may determine a specificintra/inter prediction mode.

The predictor 320 may generate a prediction signal based on variousprediction methods described below. For example, the predictor may notonly apply intra prediction or inter prediction to predict one block butalso simultaneously apply intra prediction and inter prediction. Thismay be called combined inter and intra prediction (CIIP). In addition,the predictor may be based on an intra block copy (IBC) prediction modeor a palette mode for prediction of a block. The IBC prediction mode orpalette mode may be used for content image/video coding of a game or thelike, for example, screen content coding (SCC). The IBC basicallyperforms prediction in the current picture but may be performedsimilarly to inter prediction in that a reference block is derived inthe current picture. That is, the IBC may use at least one of the interprediction techniques described in this document. The palette mode maybe considered as an example of intra coding or intra prediction. Whenthe palette mode is applied, a sample value within a picture may besignaled based on information on the palette table and the paletteindex.

The intra predictor 331 may predict the current block by referring tothe samples in the current picture. The referred samples may be locatedin the neighborhood of the current block or may be located apartaccording to the prediction mode. In the intra prediction, predictionmodes may include a plurality of non-directional modes and a pluralityof directional modes. The intra predictor 331 may determine theprediction mode applied to the current block by using a prediction modeapplied to a neighboring block.

The inter predictor 332 may derive a predicted block for the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. In this case, in order to reducethe amount of motion information transmitted in the inter predictionmode, motion information may be predicted in units of blocks, subblocks,or samples based on correlation of motion information between theneighboring block and the current block. The motion information mayinclude a motion vector and a reference picture index. The motioninformation may further include inter prediction direction (L0prediction, L1 prediction, Bi prediction, etc.) information. In the caseof inter prediction, the neighboring block may include a spatialneighboring block present in the current picture and a temporalneighboring block present in the reference picture. For example, theinter predictor 332 may configure a motion information candidate listbased on neighboring blocks and derive a motion vector of the currentblock and/or a reference picture index based on the received candidateselection information. Inter prediction may be performed based onvarious prediction modes, and the information on the prediction mayinclude information indicating a mode of inter prediction for thecurrent block.

The adder 340 may generate a reconstructed signal (reconstructedpicture, reconstructed block, reconstructed sample array) by adding theobtained residual signal to the prediction signal (predicted block,predicted sample array) output from the predictor (including the interpredictor 332 and/or the intra predictor 331). If there is no residualfor the block to be processed, such as when the skip mode is applied,the predicted block may be used as the reconstructed block.

The adder 340 may be called reconstructor or a reconstructed blockgenerator. The generated reconstructed signal may be used for intraprediction of a next block to be processed in the current picture, maybe output through filtering as described below, or may be used for interprediction of a next picture.

Meanwhile, luma mapping with chroma scaling (LMCS) may be applied in thepicture decoding process.

The filter 350 may improve subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter350 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture and store the modifiedreconstructed picture in the memory 360, specifically, a DPB of thememory 360. The various filtering methods may include, for example,deblocking filtering, a sample adaptive offset, an adaptive loop filter,a bilateral filter, and the like.

The (modified) reconstructed picture stored in the DPB of the memory 360may be used as a reference picture in the inter predictor 332. Thememory 360 may store the motion information of the block from which themotion information in the current picture is derived (or decoded) and/orthe motion information of the blocks in the picture that have alreadybeen reconstructed. The stored motion information may be transmitted tothe inter predictor 260 so as to be utilized as the motion informationof the spatial neighboring block or the motion information of thetemporal neighboring block. The memory 360 may store reconstructedsamples of reconstructed blocks in the current picture and transfer thereconstructed samples to the intra predictor 331.

In the present disclosure, the embodiments described in the filter 260,the inter predictor 221, and the intra predictor 222 of the encodingapparatus 200 may be the same as or respectively applied to correspondto the filter 350, the inter predictor 332, and the intra predictor 331of the decoding apparatus 300. The same may also apply to the unit 332and the intra predictor 331.

As described above, the encoding apparatus may perform various encodingmethods such as the exponential Golomb, the context-adaptive variablelength coding (CAVLC), the context-adaptive binary arithmetic coding(CABAC), and the like. In addition, the decoding apparatus may decodeinformation in a bitstream based on the coding methods such as theexponential Golomb, the CAVLC, the CABAC, and the like, and output thesyntax element value required for reconstructing an image and thequantized values of a transform coefficient for residual.

For example, the coding methods described above may be performed asdescribed below.

FIG. 4 illustrates the context-adaptive binary arithmetic coding (CABAC)for encoding a syntax element. For example, in the coding process of theCABAC, in the case of a syntax element of which input signal is a binaryvalue, the encoding apparatus may transform the input signal into abinary value by binarizing the input signal value. In addition, in thecase that the input signal is already a binary value (i.e., the inputsignal value is a binary value), the binarization is not performed, butbypassed. Here, each the binary values 0 and 1 constructing a binaryvalue may be referred to a bin. For example, in the case that the binarystring after the binarization is 110, each of 1, 1, 0 is referred to abin. The bin(s) for a single syntax element may represent the syntaxelement value.

Later, the binarized bins of the syntax element may be inputted to aregular encoding engine or a bypass encoding engine. The regularencoding engine of the encoding apparatus may allocate a context modelthat reflects a probability value for the corresponding bin and encodethe corresponding bin based on the allocated context model. The regularencoding engine of the encoding apparatus may update the context modelfor the corresponding bin after performing the encoding for each bin.The encoded bin described above may be referred to as a context-codedbin.

Meanwhile, in the case that the binarized bins of the syntax element isinputted to the bypass encoding engine, the binarized bins may be codedas below. For example, the bypass encoding engine of the encodingapparatus omits the process of updating the probability model applied tothe bin after a process of estimating a probability for the input binand encoding.

In the case that the bypass encoding is applied, the encoding apparatusmay encode the input bin by applying uniform probability distributioninstead of allocating the context model, and through this, the encodingspeed may be improved. The encoded bin described above may be referredto as a bypass bin.

The entropy decoding may represent a process of performing the processwhich is the same as the entropy encoding described above in a reverseorder.

For example, in the case that a syntax element is decoded based on acontext model, the decoding apparatus may receive a bin corresponding tothe syntax element through a bitstream, determine a context model byusing decoding information of a decoding target block or a neighboringblock or information of symbol/bin which is decoded in the previousstep, perform an arithmetic decoding of the bin by anticipating anoccurrence probability of the received bin, and derive the syntaxelement value. Later, the context model of a bin decoded next may beupdated to the determined context model.

In addition, for example, in the case that a syntax element isbypass-decoded, the decoding apparatus may receive the bin correspondingto the syntax element through a bitstream and decode the input bin byapplying the uniform probability distribution. In this case, thedecoding apparatus may omit the process of deriving the context model ofthe syntax element and the process of updating the context model appliedto the bin.

Meanwhile, in an embodiment, (quantized) transform coefficient (i.e.,residual information) may be encoded and/or decoded based on the syntaxelements such as transform_skip_flag, last_sig_coeff_x_prefix,last_sig_coeff_y_prefix, last_sig_coeff_x_suffix,last_sig_coeff_y_suffix, coded_sub_block_flag, sig_coeff_flag,par_level_flag, rem_abs_gt1_flag, rem_abs_gt2_flag, abs_remainder,coeff_sign_flag, mts_idx, and the like. The syntax elements related tothe encoding/decoding of residual data may be represented as thefollowing table.

TABLE 1 residual coding( x0, 0. log2TbWidth, log2TbHeight, cldx ) {Descriptor  if( transform_skip_enabled_flag && ( cIdx ! − 0 | |cu_mts_flag[ x0 ][ y0 ] − − 0 ) &&   ( log2TbWidth <− 2) && (log2TbHcight <− 2 ) )   transform skip flag 1 x0 11 !?+0,() 11 cIdx 1ae(v)  last sig coeff x prefix ae(v)  last sig coeff y prefix ae(v)  if(last sig coeff x prefix > 3 )   last sig coeff x suffix ae(v)  if( lastsig coeff y prefix > 3)   last sig coeff y suffix ae(v)  log2ShSize − (Min( log2TbWidth. log2ThHeight ) < 2 ? 1 : 2 )  numSbCooff 1 << (log2SbSizo <<1 )  lastScanPos = numSbCoeff  lastSub Block − (1 << (log2TbWidth | log2TbHeight 2 * log2SbSize ) ) 1  do {   if( lastScanPos= = 0 ) {    lastScanPos − numSbCoeff    lastSubBlock− −   }  lastScanPos   xS − DiagScanOrder[ log2TbWidth − log2SbSize ][log2TbHeight − log2SbSize ]     [ lastSubBlock ][ 0 ]   yS −DiagScanOrder[ log2TbWidth log2SbSize ][ log2TbHeight log2SbSize ]     [lastSubBlock ][ 1 ]   xC = ( xS << log2SbSize ) +    DiagScanOrder[log2SbSize ][ log2SbSize ][ lastScanPos ][ 0 ]   yC − ( yS << log2SbSize) +    DiagScanOrder[ log2SbSize ][ log2SbSize ][ lastScanPos ][ 1 ] }while( ( xC !− LastSignificantCoeffX ) | | ( yC !− LastSignificantCoeffY) ) numSigCoeff − 0 QState = 0 for( i − lastSubBlock; i >− 0;i− − ) { startQStateSb − QState  xS − DiagScanOrder[ log2TbWidth − log2SbSize ][log2TbHeight − log2SbSize ]  [ lastSubBlock ][ 0 ]  yS − DiagScanOrder[log2TbWidth − log2SbSize ][ log2TbHeight − log2SbSize ]  [ lastSubBlock][ 1 ]  inferSbDcSigCoeffFlag = 0   if( ( i < lastSubBlock ) && ( i > 0) ) {    coded_sub_block_flag[ xS ][ yS ] ae(v)    inferSbDcSigCoeffFlag− 1   }   firstSigScanPosSb − numSbCoeff   lastSigScanPosSb − −1  remBinsPass1 = ( log2SbSize < 2 ? 6 : 28)   remBnisPass2 − (log2SbSize < 2 ? 2 : 4)   firstPosMode0 − ( i − − lastSubBlock ?lastScanPos − 1 : numSbCoeff − 1 }   firstPosMode1 = −1   firstPosMode2= 1   for( n − firstPosMode0; n >− 0 && remBinsPass1 >− 3; n − − ) {   xC = ( xS << log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize][ n ][ 0 ]    yC − ( yS << log2SbSize ) + DiagScanOrder[ log2SbSize ][log2SbSize ][ n ][ 1 ]    if( coded_sub_block_flag[ xS ][ yS ] && (n > 0!inferSbDcSigCoeffFlag ) ) {     sig_coeff_flag[ xC ][ yC ] ae(v)    remBinsPass1− −     if( sig_coeff_flag[ xC ][ yC ] )     inferSbDcSigCoefflag = 0    }   if( sig_coeff_flag[ xC ][ yC ] ) {    numSigCoeff++     abs_level_gt1_flag[ n ] ae(v)     remBinsPass1− −    if( abs level gt1 flag[ n ]) {      par_level_flag[ n ]     remBinsPass1 − −      if( remBinsPass2 > 0 ) {       remBinsPass2 −−       if( remBinsPass2 = = 0 )        firstPosMode1 = n − 1      }    }     if( lastSigScanPosSb = = −1)      lastSigScanPosSb − n    firstSigScanPosSb − n    }    AbsLevelPass1[ xC ][ yC ] −      sigcoeff flag[ xC ][ yC ] + par level flag [ n ] + abs level gt1 flag [ n ]   if( dep quant enabled flag )     QState − QStateTransTable[ QState ][AhsLevelPass1[ xC ][ YG ] & 1 ]    if( remBinsPass1 < 3 )    firstPosMode2 = n 1   }   if( firstPosMode1 < firstPosMode2 )   firstPosMode1 = firstPosMode2   for( n − numSbCoeff 1; n <firstPosMode1; n ){    if( abs level gt1 flag[ n ] )     abs level gt2fag[ n ] ae(v)   }   for( n − numSbCoeff − 1:n > firstPoshlodcl: n− − ){    xC = ( xS << log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize][ n ][ 0 ]    yC − ( yS << log2SbSize ) | DiagScanOrder[ log2SbSize ][log2SbSize ][ n ][ 1 ]    if( abs level gt3 flag[ n ] )     absremainder[ n ]    AbsLevel[ xC ][ yC ] − AbsLevelPass1 [ xC ][ yC ] |      2 * ( abs level gt3 flag[ n ] + abs remainder[ n ] )   }   for( n− firstPosMode1 : n > firstPosMode2: n ){    xC = ( xS << log2SbSize ) +DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]    yC − ( yS <<log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 1 ]   if( abs level gt1 flag[ n ] )     abs remainder[ n ]    AbsLevel[ xC][ yC ] = AbsLevelPass1[ xC ][ yC ] + 2 * abs remainder[ n ]   }   for(n − firstPosMode2: n − 0; n− − ){    xC = ( xS << log2SbSize ) +DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]    yC − ( yS <<log2SbSize ) | DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 1 ]   abs level[ n ]    AbsLevel[ xC ][ yC ] = abs level[ n ]    if( abslevel[ n ] > 0 )     firstSigScanPosSb − n    if( dep quant enabled flag)     QState − QStateTransTable[ QState ][ abs level [ n ] & 1 ]   }  if( dep quant enabled flag !sign data hiding enabled flag)   signHidden − 0   else    signHidden = ( lastSigScanPosSb −firstSigScanPosSb > 3 ? 1 : 0 )   for( n − numSbCoeff 1; n >− 0: n ) {   xC = ( xS << log2SbSize ) + DiagScanOrder[ log2SbSize ][ log2SbSize][ n ][ 0 ]    yC − ( yS << log2SbSize ) + DiagScanOrder[ log2SbSize ][log2SbSize ][ n ][ 1 ]    if( sig_coeff flag[ xC ][ yC ] &&     (!signHidden | | ( n !− firstSigScanPosSb ) ) )     coeff sign flag[ n ]ae(v)   }   if( dep quant enabled flag) {    QState = startQStateSb   for( n − numSbcoeff 1: n − 0;n ) {     xC − ( xS << log2SbSize ) +      DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][ 0 ]     yC − ( yS<< log2SbSize ) +       DiagScanOrder[ log2SbSize ][ log2SbSize ][ n ][1 ]     if( sig coeff flag[ xC ][ yC ] )      TransCoeffLevel[ x0 ][ y0][ cIdx ][ xC ][ yC ] =        ( 2* AbsLevel[ xC ][ yC ] ( QState > 1 ?1 : 0 ) )*        ( 1 − 2 * coeff sign flag[ n ] )     QState =QStateTransTable[ QState ][ par level flag[ n ]]   } else {   sumAbsLevel − 0    for( n = numSbCoeff − 1;n >=0; n− −) {     xC − (xS << log2SbSize ) +       DiagScanOrder[ log2SbSize ][ log2SbSize ][ n][ 0 ]     yC =( yS << log2SbSize ) +       DiagScanOrder[ log2SbSize ][log2SbSize ][ n ][ 1 ]     if( sig coeff flag[ xC ][ yC ]) {     TransCoeffLevel[ x0 ][ y0 ][ cIdx ][ xC ][ yC ] =        AbsLevel[xC ][ yC ] 1*( 1 − 2* coeff' sign flag[ n ] )      if( signHidden ) {      sumAbsLevel += AbsLevel[ xC ][ yC ]       if( ( n − −firstSigScanPosSb) && ( sumAbsLevel % 2 ) − − 1 ) )       TransCoeffLevel[ x0 ][ y0 ][ cIdx ][ xC ][ yC ] =         ..TransCoeffLevel[ x0 ][ y0 ][ cIdx ][ xC ][ yC ]       }      }     }   }   }  }  if( cu_mts_flag[ x0 ][ y0 ] && ( cIdx = = 0 ) &&  !transform skip flag[ x0 ][ y0 ][ cIdx ] &&   ( ( CuPredMode[ x0 ][ y0] − − MODE INTRA && numSigCoeff > 2 ) | |   ( CuPredMode[ x0 ][ y0 ] − −MODE INTER ) ) ){   mts idx[ x0 ][ y0 ] ae(v) }

transform_skip_flag represents whether a transform is omitted in anassociated block. The transform_skip_flag may be a syntax element of atransform skip flag. The associated block may be a coding block (CB) ora transform block (TB). For the transform (and quantization) andresidual coding process, a CB and a TB may be used in a mixed manner.For example, it is as described above that residual samples may bederived for a CB, and (quantized) transform coefficients may be derivedthrough transform and quantization for the residual samples, and throughthe residual coding process, information representing a position, asize, a code, and the like of the (quantized) transform coefficientsefficiently (e.g., syntax elements) may be generated and signaled. Thequantized transform coefficients may be called transform coefficients,simply. Generally, in the case that a CB is not greater than a maximumTB, a size of CB may be equal to a size of TB, and in this case, atarget block which is transformed (and quantized) and residual-coded maybe called a CB or a TB. Meanwhile, in the case that a CB is not greaterthan a maximum TB, a target block which is transformed (and quantized)and residual-coded may be called a TB. Hereinafter, it is described thatsyntax elements related to residual coding are signaled in a unit of TB,but this is just an example, and the TB may be used with the CB in amixed manner, as described above.

As an embodiment, the encoding apparatus may encode (x, y) positioninformation of a transform coefficient of which the last block in atransform block is not zero based on syntax elements,last_sig_coeff_x_prefix, last_sig_coeff_y_prefix,last_sig_coeff_x_suffix and last_sig_coeff_y_suffix. More particularly,the last_sig_coeff_x_prefix represents a prefix of a column position ofthe last significant coefficient in a scanning order in a transformblock, the last_sig_coeff_y_prefix represents a prefix of a row positionof the last significant coefficient in the scanning order in thetransform block, the last_sig_coeff_x_suffix represents a suffix of acolumn position of the last significant coefficient in a scanning orderin a transform block, and the last_sig_coeff_y_suffix represents asuffix of a row position of the last significant coefficient in thescanning order in the transform block. Here, the significant coefficientmay represent a non-zero coefficient. In addition, the scanning ordermay be a horizontal scanning order or a vertical scanning order. Thescanning order may be determined based on whether intra/inter predictionis applied to a target block (CB or CB including TB) and/or a specificintra/inter prediction.

Next, the encoding apparatus may split the transform block into 4×4sub-blocks and represent whether a non-zero coefficient is present in acurrent sub-block by using the 1-bit syntax element coded_sub_block_flagfor each of the 4×4 sub-blocks.

Since there is no further information to transmit when thecoded_sub_block_flag value is 0, the encoding apparatus may terminatethe encoding process for the current sub-block. On the other hand, whenthe coded sub_block_flag value is 1, the encoding apparatus may performthe encoding process for sig_coeff_flag continuously. For the sub-blockincluding the last non-zero coefficient, encoding for thecoded_sub_block_flag is not required, and it is highly probable that thesub-block including DC information of a transform block includes anon-zero coefficient, and accordingly, it may be assumed that thecoded_sub_block_flag is not encoded, and the value is 1.

In the case that the coded_sub_block_flag value is 1, and it isdetermined that a non-zero coefficient is present in the currentsub-block, the encoding apparatus may encode the sig_coeff_flag having abinary value according to the order which is reversely scanned. Theencoding apparatus may encode the 1 bit syntax element sig_coeff_flagfor each transform coefficient according to the scanning order. In thecase that a transform coefficient value in the current scan position isnon-zero, the sig_coeff_flag value may be 1. Here, in the case of thesub-block including the last non-zero coefficient, since thesig_coeff_flag is not required to be encoded for the last non-zerocoefficient, the encoding process for the sub-block may be omitted. Alevel information encoding may be performed only in the case that thesig_coeff_flag is 1, and for the level information encoding process,four syntax elements may be used. More particularly, eachsig_coeff_flag[xC][yC] may represent whether a level (value) of thecorresponding transform coefficient in each transform coefficientposition (xC, yC) in a current TB is non-zero. As an embodiment, thesig_coeff_flag may correspond to an example of the syntax element of asignificant coefficient flag that represent whether a quantizedtransform coefficient is the significant coefficient, which is non-zero.

The remaining level value after encoding for the sig_coeff_flag may bederived as represented in the following equation. That is, the syntaxelement remAbsLevel representing a level value to be encoded may bederived as represented in the following equation.

[96]  [Equation 1]

Here, coeff means an actual transform coefficient value.

In addition, the least significant coefficient (LSB) of remAbsLeveldenoted in Equation 1 described above may be encoded as represented inEquation 2 below through par_level_flag.

par_level_flag=remAbsLevel&1  [Equation 2]

Here, par_level_flag[n] may represent a parity of a transformcoefficient level (value) in a scanning position n.

The transform coefficient level value remAbsLevel which is to be encodedafter encoding the par_level_flag may be updated as represented in thefollowing equation.

remAbsLevel′=remAbsLevel>>1  [Equation 3]

rem_abs_gt1 flag may represent whether remAbsLevel′ in the correspondingscanning position (n) is greater than 1, and rem_abs_gt2_flag mayrepresent whether remAbsLevel′ in the corresponding scanning position(n) is greater than 2. Encoding for the abs_remainder may be performedonly in the case that the rem_abs_gt2_flag is 1. The relationshipbetween coeff, which is an actual transform coefficient, and each of thesyntax elements may be as represented in the following equation.

|coeff|=sig_coeff_flag+par_level_flag+2*(rem_abs_gt1_flag+rem_abs_gt2_flag+abs_remainder)  [Equation4]

In addition, the following table represents examples in relation toEquation 4 described above.

TABLE 2 [coeff] sig_coeff_flag par_level_flag rem_abs_gt1_flagrem_abs_gt2_flag abs remainder 0 0 1 1 0 0 2 1 1 0 3 1 0 1 0 4 1 1 1 0 51 0 1 1 0 6 1 1 1 1 0 7 1 0 1 1 1 8 1 1 1 1 1 9 1 0 1 1 2 10 1 1 1 1 211 1 0 1 1 3 . . . . . . . . . . . . . . . . . .

Here, |coeff| may represent a transform coefficient level (value) andmay be represented as AbsLevel for a transform coefficient. In addition,a sign of each coefficient may be encoded by using coeff_sign_flag whichis 1 bit symbol.

Meanwhile, in an embodiment, the par_level_flag may represent an exampleof the syntax element of the parity level flag for the parity of thetransform coefficient level for the quantized transform coefficient, therem_abs_gt1_flag may represent an example of the syntax element of afirst transform coefficient level flag on whether the transformcoefficient level is greater than a first threshold value, and therem_abs_gt2_flag may represent an example of the syntax element of asecond transform coefficient level flag on whether the transformcoefficient level is greater than a second threshold value.

FIG. 5 is a diagram illustrating examples of transform coefficients in a4×4 block.

The 4×4 block shown in FIG. 5 shows an example of quantizedcoefficients. The block shown in FIG. 5 may be a 4×4 transform block ora 4×4 sub-block of 8×8, 16×16, 32×32 or 64×64 transform block. The 4×4block shown in FIG. 5 may represent a luma block or a chroma block.

For example, the encoding result for coefficients that are scanned inreverse diagonal direction of FIG. 5 may be as represented in thefollowing table.

TABLE 3 scan_pos 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 coefficients 0 00 0 1 −1 0 2 0 3 −2 −3 4 6 −7 10 sig_coeff_flag 0 0 0 0 1 1 0 1 0 1 1 11 1 1 1 par_level_flag 0 0 1 0 1 0 1 1 0 1 rem_abs_gt1_flag 0 0 0 1 0 11 1 1 1 rem_abs_gt2_flag 0 0 0 1 1 1 abs_remainder 0 1 2 ceoff_sign_flag0 1 0 0 1 1 0 0 1 0

In Table 3 above, scan_pos represents a position of coefficientaccording to reverse diagonal scan. scan_pos 15 may be a transformcoefficient which is firstly scanned in the 4×4 block, that is, a bottomright transform coefficient, and scan_pos 0may be a transformcoefficient which is lastly scanned in the 4∴4 block, that is, a topleft transform coefficient. For example, the scan_pos 0 may be referredto as scan position 0.

Meanwhile, as described above, in the case that an input signal is not abinary value but a syntax element, the encoding apparatus may transformthe input signal into a binary value by binarizing the input signalvalue. Furthermore, the decoding apparatus may derive a binarized value(i.e., binarized bin) of the syntax element by decoding the syntaxelement and derive a value of the syntax element by inverse-binarizingthe binarized value. The binarization process may be performed byTruncated Rice (TR) binarization process, k-th order Exp-Golomb (EGk)binarization process, or Fixed-length (FL) binarization process, whichare described below. In addition, the inverse binarization process mayrepresent a process of deriving a value of the syntax element by beingperformed based on the TR binarization process, the EGk binarizationprocess or the FL binarization process.

For example, the TR binarization process may be performed as below.

An input to the TR binarization process may be a request for a TRbinarization, cMax and cRiceParam. Furthermore, an output of the TRbinarization process may be the TR binarization associating the valuesymbolVal with a corresponding bin string.

Particularly, as an example, in the case that a suffix bin string forthe syntax element is present, the TR bin string for the syntax elementmay be a concatenation of a prefix bin string and the suffix bin string,and in the case that a suffix bin string for the syntax element is notpresent, the TR bin string for the syntax element may be the prefix binstring. For example, the prefix bin string may be derived as describedbelow.

The prefix value of the symbolVal for the syntax element may be derivedas represented in the following equation.

prefixVal=symbolVal>>cRiceParam  [Equation 5]

Herein, prefixVal may represent the prefix value of the symbolVal. Theprefix of the TR bin string of the syntax element (i.e., prefix binstring) may be derived as described below.

For example, in the case that the prefixVal is less thancMax>>cRiceParam, the prefix bin string may be a bit string of lengthprefixVal+1 indexed by binIdx. That is, in the case that the prefixValis less than cMax>>cRiceParam, the prefix bin string may be a bit stringof prefixVal+1 bit number indexed by binIdx. The bins for binIdx lessthan prefixVal may be equal to 1. In addition, the bin with binIdx equalto prefixVal may be equal to 0.

For example, the following table represents the bin strings derived byunary binarization for prefixVal.

TABLE 4 prefixVal Bin string 0 0 1 1 0 2 1 1 0 3 1 1 1 0 4 1 1 1 1 0 5 11 1 1 1 0 . . . binIdx 0 1 2 3 4 5

Meanwhile, in the case that the prefixVal is not less thancMax>>cRiceParam, the prefix bin string may be a bit string with allbins being equal to 1.

In addition, in the case that cMax is greater than symbolVal andcRiceParam is greater than 0, the suffix bin string of the TR bin stringmay be present. For example, the suffix bin string may be derived asfollows:

The suffix value of the suffixVal for the syntax element may be derivedas represented in the following equation.

suffixVal=symbolVal−((prefixVal)<<cRiceParam)  [Equation 6]

Herein, suffixVal may represent a suffix value of the symbolVal.

The suffix (i.e., suffix bin string) of the TR bin string may be derivedbased on the FL binarization process for suffixVal with a cMax valueequal to (1<<cRiceParam)−1.

Meanwhile, in the case that the input parameter cRiceParam value is 0,the TR binarization may be exactly a truncated unary binarization and acMax value equal to the largest possible value of the syntax elementbeing decoded may be used always.

In addition, for example, the EGk binarization process may be performedas below. Syntax elements coded as ue(v) may be Exp-Golomb-coded syntaxelement.

As an example, 0-th order Exp-Golomb (EGO) binarization process may beperformed as below.

The parsing process for the syntax elements may begin with reading thebits including the first non-zero bit starting at the current locationin the bitstream and counting the number of leading bits that are equalto 0. This process may be represented as the following table.

TABLE 5   leadingZeroBits = −1   for( b = 0; !b; leadingZeroBits++ )   b = read bits( 1 )

The variable codeNum may be derived as represented in the followingequation.

codeNum=2^(leadingZeroBits)−1+read_bits(leadingZeroBits)  [Equation 7]

Herein, the value returned from read_bits (leadingZeroBits), that is,the value represented by read_bits (leadingZeroBits) may be interpretedas a binary representation of an unsigned integer with most significantbit written first.

The following table may illustrate the structure of the Exp-Golomb codeby separating the bit string into “prefix” and “suffix” bits.

TABLE 6 Bit string form Range of codeNum 1 0 0 1 x₀ 1..2 0 0 1 x₂ x₀3..6 0 0 0 1 x₂ x₁ x₀ 7..14 0 0 0 0 1 x₃ x₂ x₁ x₀ 15..30 0 0 0 0 0 1 x₄x₃ x₂ x₁ x₀ 31..62 . . . . . .

The “prefix” bits may be those bits that are parsed as specified abovefor the computation of leadingZeroBits. That is, the bit string shown aseither 0 or 1 in Table 6 above may represent prefix bit string. The“suffix” bits may be those bits that are parsed in the computation ofcodeNum and may be shown as xi in Table 6. That is, the bit stringrepresented with xi in Table 6 above may represent the suffix bitstring. Here, i may be a value in the range of 0 to leadingZeroBits−1.Furthermore, each xi may be equal to either 0 or 1.

The bit string assigned to the codeNum may be as represented in thefollowing table.

TABLE 7 Bit string codeNum 1 0 0 1 0 1 0 1 1 2 0 0 1 00 3 0 0 1 0 1 4 00 1 1 0 5 0 0 1 1 1 6 0 0 0 1 0 0 0 7 0 0 0 1 0 0 1 8 0 0 0 1 0 1 0 9 .. . . . .

In the case that a descriptor of the syntax element is ue(v), that is,the syntax element is coded as ue(v), the value of the syntax elementmay be equal to codeNum.

In addition, for example, the EGk binarization process may be performedas below.

An input to the EGk binarization process may be a request for the EGkbinarization. In addition, an output of the EGk binarization process maybe the EGk binarization associating a value symbolVal corresponding tobin string.

The bit string of the EGk binarization process for symbolVal may bederived as follows.

TABLE 8 absV = Abs( symbol Val )   stopLoop = 0 do  if( absV >= ( 1 << k) ) {   put( 1 )   absV = absV − ( 1 << k)   k++  } else {   put( 0 )  while( k−− )    put( ( absV >> k ) & 1 )   stopLoop = 1  } while(!stopLoop )

Referring to Table 8 above, a binary value X may be added at the end ofthe bin string through each call of put(X). Herein, X may be equal to 0or 1.

In addition, for example, the FL binarization process may be performedas below.

An input to the FL binarization process may be a request for the FLbinarization and cMax for the syntax element. Furthermore, an output ofthe FL binarization process may be the FL binarization associating eachvalue symbolVal corresponding to bin string.

The FL binarization may be constructed by using a bit string having afixed length bit number of symbol value symbolVal. Here, the fixedlength bit may be an unsigned integer bin string. That is, a bit stringfor the symbol value symbolVal may be derived through the FLbinarization, and the bit length (i.e., bit number) of the bit stringmay be a fixed length.

For example, the fixed length may be derived as represented in thefollowing equation.

fixedLength=Ceil(Log 2(cMax+1))  [Equation 8]

The indexing of bins for the FL binarization may be a scheme of usingincreasing values in an order from the most significant bit to the leastsignificant bit. For example, the bin index associated with the mostsignificant bit may be binIdx=0.

Meanwhile, for example, in the residual information, a binarizationprocess for the syntax element abs_remainder may be performed as below.

An input to the binarization process for abs_remainder may be a requestfor a binarization for the syntax element abs_remainder[n], the colorcomponent cIdx, the luma location (x0, y0), the current coefficient scanlocation (xC, yC), the binary logarithm of the transform block width log2TbWidth, and the binary logarithm of the transform block height log2TbHeight. The luma location (x0, y0) may indicate the top-left sampleof the current luma transform block relative to the top-left luma sampleof the picture.

An output of the binarization process for abs_remainder may be thebinarization of the abs_remainder (i.e., binarized bin string of theabs_remainder). The available bin strings may be derived for theabs_remainder through the binarization process.

The Rice parameter cRiceParam for the abs_remainder may be derivedthrough the Rice parameter derivation process with the color componentcIdx, the luma location (x0, y0), the current coefficient scan location,and the transform block height log 2TbHeight as inputs. Detaileddescription for the Rice parameter derivation process is describedbelow.

In addition, for example, the cMax for the abs_remainder may be derivedbased on the Rice parameter cRiceParam for the abs_remainder. The cMaxmay be derived from the following equation.

cMax=(cRiceParam==1?6:7)<<cRiceParam[Equation 9]

Referring to Equation 9 above, when the cRiceParam value is 1, the cMaxmay be derived as 6<<cRiceParam, and when the cRiceParam value is not 1,the cMax may be derived as 7<<cRiceParam.

Meanwhile, the binarization of the abs_remainder, that is, the binstring for the abs_remainder may be a concatenation of a prefix binstring and a suffix bin string in the case that the suffix bin string ispresent. In addition, in the case that the suffix bin string is notpresent, the bin string for the abs_remainder may be the prefix binstring.

For example, the prefix bin string may be derived as follows.

The prefix value of the abs_remainder, prefixVal, may be derived asrepresented in the following equation.

prefixVal=Min(cMax,abs_remainder[n])  [Equation 10]

The prefix (i.e., prefix bin string) of the abs_remainder may be derivedthrough the TR binarization process for prefixVal with the variablescMax and cRiceParam as inputs.

When the prefix bin string is equal to the bit string of length 4 withall bits equal to 1, the suffix bin string of the bin string of theabs_remainder may be present, and may be derived as follows.

The suffix value of the abs_remainder, suffixVal, may be derived asrepresented in the following equation.

suffixVal=abs_remainder[n]cMax  [Equation 11]

The suffix bin string of the bin string of the abs__remainder may bederived through the EGk binarization process for the suffixVal with kset equal to cRiceParam+1.

Meanwhile, the Rice parameter derivation process may be as below.

An Input to the Rice parameter derivation process may be the colorcomponent index cIdx, the luma location (x0, y0), the currentcoefficient scan location (xC, yC), the binary logarithm of thetransform block width log 2TbWidth, and the binary logarithm of thetransform block height log 2TbHeight. The luma location (x0, y0) mayindicate the top-left sample of the current luma transform blockrelative to the top-left luma sample of the picture. In addition, anoutput of the Rice parameter derivation process may be the Riceparameter cRiceParam.

For example, Given the syntax elements sig_coeff_flag[x][y] and thearray AbsLevel[x][C] for the transform block with component index cIdxand the top-left luma location (x0, y0), the variable locSumAbs may bederived as the pseudo code represented in the following table.

TABLE 9 locSumAbs = 0 if( xC < (1 << log2TbWidth) − 1 ) {  locSumAbs +=AbsLevel┌ xC + 1 ┐┌ yC ┐ − sig_coeff_flag┌xC +  1 ┐┌ yC ┐  if( xC < (1<< log2TbWidth) − 2 )   locSumAbs += AbsLevel┌ xC + 2 ┐┌ yC ┐ −sig_coeff_   flag┌ xC + 2 ┐┌ yC ┐  if( yC < (1 << log2TbHeight) − 1 )  locSumAbs += AbsLevel┌ xC + 1 ┐┌ yC + 1 ┐ − sig_coeff_   flag┌ xC + 1┐┌ yC + 1 ┐ } if( yC < (1 << log2TbHeight) − 1 ) {  locSumAbs +=AbsLevel┌ xC ┐┌ yC + 1┐ − sig_coeff_  flag┌ xC ┐┌ yC + 1 ┐  if( yC < (1<< log2TbHeight) − 2 )   locSumAbsPass1 += AbsLevelPass1 ┌ xC ┐┌ yC + 2┐ − sig_   coeff_flag┌ xC ┐┌ yC + 2 ┐ }

The Rice parameter cRiceParam may be derived as follows.

For example, in the case that the locSumAbs is less than 12, thecRiceParam may be set equal to 0. Otherwise, in the case that thelocSumAbs is less than 25, not corresponding to the above condition(i.e., the locSumAbs is 12 or more and less than 25), the cRiceParam maybe set equal to 1. Otherwise, in the case of not corresponding to theabove condition (i.e., the locSumAbs is greater than or equal to 25),the cRiceParam may be set equal to 2.

Meanwhile, as represented in Table 1 described above, according to theVVC standard, before encoding/decoding a residual signal (i.e., residualinformation), it may be transferred first whether to apply the transformof a corresponding block. That is, before the residual information of acurrent block is parsed, a transform skip flag (i.e.,transform_skip_flag) that represents whether to apply the transform maybe parsed first. The transform skip flag may also be referred to as aflag whether to transform or a flag whether to apply transform.

By representing correlation between residual signals in a transformdomain, a compaction of data is performed, and this is transferred tothe decoding apparatus, but in the case that correlation betweenresidual signals is deficient, data compaction may not be performedsufficiently. In such a case, the transform process including complexcomputation process may be omitted, and a residual signal of a pixeldomain (space domain) may be transferred to the decoding apparatus.Since the residual signal of a pixel domain to which transform is notapplied may have different property (e.g., distribution of residualsignals, absolute level of each residual signal, etc.) from the residualsignal of a normal transform domain, it is proposed a residual signalencoding/decoding method for transferring the signal to a decoderefficiently.

FIG. 6 illustrates a decoding apparatus for performing a method fortransferring a residual signal of a pixel domain which is proposed.

A transform skip flag may be transmitted in a transform block unit.Here, referring to Table 1 described above, the transform skip flag maybe parsed with being restricted to a specific block size. That is,referring to Table 1 described above, the transform skip flag may beparsed only for a transform block of which block size is a specific sizeor less. For example, in the case that a size of a current transformblock is 4×4 size or less, the transform skip flag for the currenttransform block may be parsed.

In relation to this, as an example, in the present disclosure, it isproposed an embodiment of configuring a size of block that determineswhether to parse the transform skip flag in various manner.Particularly, sizes of Log 2TbWidth and log 2TbHeight may be determinedas variables wN and hN, respectively, and according to the conventionalmethods, the wN and hN may be selected as one of the followings.

-   -   wN={2, 3, 4, 5, 6}    -   hN={2, 3, 4, 5, 6}

That is, the wN may be selected as one of 2, 3, 4, 5 and 6, and the hNmay be selected as one of 2, 3, 4, 5 and 6.

However, for example, according to the embodiment proposed in thepresent disclosure, the wN and the hN may not be limited to specificvalues. The method of parsing the transform skip flag according to thepresent embodiment may be represented as the following table.

TABLE 10  if( transform_skip_enabled_flag && ( cldx ! = 0 | |cu_mts_flag[ x0 ][ y0 ] = = 0 ) &&  ( log2TbWidth <= wN ) && (log2TbHeight <= hN ) )  transform_skip_flag[ x0 ][ y0 ][ cldx ] ae(v)

According to the present embodiment represented in Table 10, in the casethat Log 2 TbWidth representing a width of a current block (i.e.,current transform block) is wN or less and log 2TbHeight representing aheight of the current block is hN or less, the transform skip flag forthe current block may be parsed. Based on the transform skip flag, amethod of decoding a residual signal of the current block may bedetermined. Through the proposed embodiment, signals of whichstatistical properties are different are efficiently processed, andaccordingly, complexity in the entropy decoding process may be reduced,and encoding efficiency may be improved.

Meanwhile, according to the VVC standard, based on level summation ofneighboring 5 transform coefficients of the current transformcoefficient already encoded and sig_coeff_flag information, a Riceparameter for the transform coefficient of a current scanning positionmay be determined. Particularly, for example, the Rice parameter may bederived like the pseudo code represented in Table 9 described above. Inthis case, a problem may occur that it needs to be checked in every timewhether positions of transform coefficients which are referred exceed atransform block boundary. That is, whenever a single transformcoefficient level is encoded/decoded, 5 boundary checking processes maybe accompanied. Accordingly, since 5 times of boundary checking processof a transform coefficient of a size that requires encoding/decoding ofthe syntax element abs_remainder, a problem of increasing computationcomplexity may occur when many transform coefficients having great levelvalues are generated. In other words, since multiple boundary checkingprocess needs to be performed to encode/decode transform coefficientshaving non-zero abs_remainder value, there may be a problem ofincreasing computation complexity as the number of transformcoefficients of which abs_remainder value is non-zero increases. Inaddition, in the case of a residual coefficient which is not transformed(quantized later), since the residual coefficient is a residualcoefficient defined in the pixel domain, the residual coefficient mayhave little correlation with a neighboring residual coefficient and haverandomness.

Accordingly, the present disclosure may propose an embodiment of using afixed Rice parameter for a residual signal which is not transformed(i.e., the case that transform_skip_flag value is 1) without regard to alevel value of a neighboring transform coefficient which is alreadydecoded. Through this, computation complexity may be reduced whileresidual coding efficiency is maintained. The transform coefficient mayalso be referred to as a residual coefficient.

Meanwhile, in the case of limiting a summation of sig_coeff_flag,rem_abs_gt1_flag, par_level_flag numbers, the abs_remainder may bedetermined differently depending on the following three cases. Forexample, according to a method of limiting a summation ofsig_coeff_flag, rem_abs_gt1_flag, par_level_flag numbers, the following(i), (ii) and (iii) may be sequentially occurred in a single lower block(i.e., current transform block).

(i) All of sig_coeff_flag, par_level_flag, rem_abs_gt1_flag andrem_abs_gt2_flag are present.

(ii) Only sig_coeff_flag, par_level_flag and rem_abs_gt1_flag arepresent.

(iii) All of sig_coeff_flag, par_level_flag, rem_abs_gt1_flag andrem_abs_gt2_flag are not present.

Alternatively, in the case of limiting a summation of sig_coeff_flag,coeff_sign_flag, abs_level_gtX_flag[0], par_level_flag numbers, theabs_remainder may be determined differently depending on the followingthree cases. For example, according to a method of limiting a summationof sig_coeff_flag, coeff_sign_flag, abs_level_gtX_flag[0],par_level_flag numbers, the following (i), (ii) and (iii) may besequentially occurred in a single lower block (i.e., current transformblock).

(i) All of sig_coeff_flag, par_level_flag, coeff_sign_flag andabs_level_gtX_flag[0] are present.

(ii) Only sig_coeff_flag, par_level_flag and abs_level_gtX_flag[0] arepresent.

(iii) All of sig_coeff_flag, par_level_flag, coeff_sign_flag andabs_level_gtX_flag[0] are not present.

For (i) case above, the relationship between an actual transformcoefficient value coeff and the abs_remainder may be as represented inEquation 4 described above.

In addition, for (ii) case above, the relationship between an actualtransform coefficient value coeff and the abs_remainder may be asrepresented in the following equation.

|coeff|=sig_coeff_flag+par_level_flag+2*(rem_abs_gt1_flag+abs_remainder)  [Equation12]

Furthermore, for (iii) case above, the relationship between an actualtransform coefficient value coeff and the abs_remainder may be asrepresented in the following equation.

|coeff|=abs_level  [Equation 13]

Referring to the above description, since computation complexityincrease in proportional to a size of a reference transform coefficientwhich is used in the Rice parameter derivation, the present disclosureproposes an embodiment of calculating a Rice parameter by using a levelvalue which is right before under a scan order.

Particularly, according to the present embodiment, a Rice parameter maybe initialized only in a starting step of a lower block, and abinarization for the abs_remainder of the lower block may be performedby using a Rice parameter of a fixed value in the lower block withoutupdating the Rice parameter. For example, the Rice parameter may be setto a value among 0, 1, 2, 3, 4 and 5. That is, the Rice parameter forall abs_remainders in a block may be set to a specific value, and thespecific value may be one of 0, 1, 2, 3, 4 and 5.

In addition, for example, the Rice parameter may be controlled dependingon a transform skip flag. Furthermore, the Rice parameter value may beapplied adaptively depending on whether the current block is the lumacomponent or the chroma component.

Alternatively, for example, the Rice parameter value may be appliedadaptively depending on a size of a lower block (i.e., current transformblock). As an example, in the case that the lower block is a block of asize which is less than a specific size, the Rice parameter for thelower block may be defined as zero, and in the case that the lower blockis a block of a size which is a specific size or more, the Riceparameter for the lower block may be defined as 1. The specific size maybe derived as 4×4 size, 8×8 size, 16×16 size, 32×32 size, or the like.For example, in the case that the lower block is a block of a size whichis 4×4 size or more, the Rice parameter for the lower block may bedefined as 1.

The step of being encoded in the Rice coding may be represented by thestep of encoding the abs_remainder in the (i), the step of encoding theabs remainder in the (ii), and the step of encoding the abs_remainder inthe (iii).

FIGS. 7a and 7b illustrate the proposed embodiment of deriving the Riceparameter and a Rice parameter deriver performing the embodiment.

Referring to FIG. 7a , the encoding apparatus/decoding apparatus maydetermine whether a value of the transform skip flag of a current blockis zero (S700). In the case that the value of the transform skip flag iszero (i.e., the case that transform is applied to the current block),the encoding apparatus/decoding apparatus may set the Rice parameter forthe current block as zero (S710). And the Rice parameter may be updatedin a transform coefficient unit (S720).

In addition, in the case that the value of the transform skip flag is 1(i.e., the case that transform is not applied to the current block), theencoding apparatus/decoding apparatus may set the Rice parameter for thecurrent block as N (S730). That is, the Rice parameter may beidentically set for the transform coefficients of the current block, andset to N. Here, N may be one of 0, 1, 2, 3, 4 and 5.

Meanwhile, FIG. 7b illustrates the Rice parameter deriver performing theembodiment of deriving the Rice parameter which is proposed. The Riceparameter deriver shown in FIG. 7b may be included in the entropyencoder 240 of the encoding apparatus and may be included in the entropydecoder 310 of the decoding apparatus.

On the other hand, as another example of deriving the Rice parameter,derivation of the Rice parameter may be applied adaptively depending ona size of a lower block (i.e., current transform block). For example, inthe case that the lower block is a block of which sample number is lessthan 256, the Rice parameter for the lower block may be defined as 1,and in the case that the lower block is a block of which sample numberis 256 or more, the Rice parameter for the lower block may be defined as2.

Alternatively, for example, derivation of the Rice parameter may beapplied adaptively depending on a ratio of width and height of a lowerblock (i.e., current transform block). For example, in the case that theratio of width/height of the lower block is 2, that is, in the case thatwidth/height of the lower block is greater than 2 or less than ½, theRice parameter for the lower block may be defined as 0, and otherwise,the Rice parameter for the lower block may be defined as 1.

The step of being encoded in the Rice coding may be represented by thestep of encoding the abs_remainder in the (i), the step of encoding theabs_remainder in the (ii), and the step of encoding the abs_remainder inthe (iii).

FIG. 8 illustrates a Rice parameter deriver performing the embodiment.The Rice parameter deriver shown in FIG. 8 may derive the Rice parameterfor a current block based on a size of the current block and a transformskip flag of the current block. Here, the current block may be atransform block (TB). The Rice parameter deriver shown in FIG. 8 may beincluded in the entropy encoder 240 of the encoding apparatus andincluded in the entropy decoder 310 of the decoding apparatus.

FIG. 9 illustrates a residual encoding method performed by the encodingapparatus.

Referring to FIG. 9, the encoding apparatus may perform a residualcoding process for (quantized) transform coefficients. As describedabove, the encoding apparatus may perform residual coding of the(quantized) transform coefficients in a current block (current CB orcurrent TB) according to a scanning order. For example, the encodingapparatus may generate and encode the syntax elements for the residualinformation as represented in Table 1 described above. Steps S900 toS920 may be included in the residual information encoding process.

Particularly, the encoding apparatus may derive a value for theabs_remainder and derive a Rice parameter for the abs_remainder whilecoding sig_coeff_flag, par_level_flag, rem_abs_gt1_flag,rem_abs_gt2_flag, and the like (S900). The Rice parameter derivation maybe performed based on a neighboring reference transform coefficient asdescribed above or determined based on a transform skip flag and/orTransform Block (TB) size. The Rice parameter derivation process may bethe same as one of those described in the embodiment.

The encoding apparatus may perform a binarization corresponding to avalue for the abs_remainder based on the derived Rice parameter (S910).That is, the encoding apparatus may binarize the value for theabs_remainder based on the derived Rice parameter and derive acorresponding bin string. Here, the binarization process may include thebinarization process description for the abs_remainer described above.The encoding apparatus may derive the bin string for the abs_remainderthrough the binarization process. According to the present disclosure,as described above, based on the Rice parameter, a length of the binstring for the abs_remainder value may be adaptively determined.

The Rice parameter derivation process may be omitted for sig_coeff_flag,par_level_flag, rem_abs_gt1_flag, rem_abs_gt2_flag, and the like, whichare binarized based on the FL binarization process without using theRice parameter. The binarized based on the FL binarization process, notthe binarization process based on the Rice parameter, may be performedfor the sig_coeff_flag, the par_level_flag, the rem_abs_gt1_flag, therem_abs_gt2_flag, and the like.

The encoding apparatus may perform entropy encoding for the syntaxelements related to residual coding including the abs_remainder (S920).The encoding apparatus may perform entropy encoding based on the binstring for the abs remainder. The encoding apparatus may perform entropyencoding based on the bin string context based on the entropy codingtechnique such as context-adaptive arithmetic coding (CABAC),context-adaptive variable length coding (CAVLC), or the like, and theoutput may be included in a bitstream. The bitstream may include varioustypes of information for image/video decoding such as predictioninformation in addition to the residual information including theinformation for the abs_remainder as described above. As describedabove, the bitstream may be forwarded to the decoding apparatus througha (digital) storage medium or a network.

FIG. 10 illustrates the entropy encoder 240 of the encoding apparatusperforming the residual encoding method. Referring to FIG. 10, theentropy encoder 240 may include a Rice parameter deriver 241, abinarization unit 242 and an entropy encoding processor 243. The Riceparameter derivation process may be performed by the Rice parameterderiver 241 in the entropy encoder 240. In addition, the binarizationprocess may be performed by the binarization unit 242 in the entropyencoder 240. The entropy encoding process may be performed by theentropy encoding processor 243 in the entropy encoder 240.

FIG. 11 illustrates a residual decoding method performed by the decodingapparatus.

Referring to FIG. 11, the decoding apparatus may derive (quantized)transform coefficients by decoding the encoded residual information. Forexample, the decoding apparatus may derive (quantized) transformcoefficients by decoding the residual information encoded in a currentblock (current CB or current TB) as described above. For example, thedecoding apparatus may decode the syntax elements for the residualinformation as represented in Table 1 described above and derive(quantized) transform coefficients by interpreting values of the syntaxelements. Steps S1100 to S1120 may be included in the residualinformation decoding process.

Particularly, the decoding apparatus may derive a Rice parameter for thesyntax element abs_remainder (S1100). The Rice parameter derivation maybe performed based on a neighboring reference transform coefficient asdescribed above or determined based on a transform skip flag thatrepresents whether to apply transform and/or TB size. The Rice parameterderivation process may be the same as one of those described in theembodiment.

The decoding apparatus may perform a binarization for the abs_remainderbased on the derived Rice parameter (S1110). That is, the decodingapparatus may derive available bin strings for available values for theabs_remainder through the binarization process for the abs_remainder.According to the present disclosure, as described above, based on theRice parameter, a length of the bin string for the abs_remainder valuemay be adaptively determined.

The decoding apparatus may perform entropy encoding for the syntaxelements related to residual coding including the abs_remainder (S1120).The decoding apparatus may compare the derived bin string with theavailable bin strings while parsing and decoding each of the bins forthe abs_remainder. In the case that the derived bin string is equal to aspecific bin string which is one of the available bin strings, a valuecorresponding to the specific bin string as the value of theabs_remainder. Otherwise, the decoding apparatus may further parse anddecode a next bit for the abs_remainder in the bistream and perform thecomparison process. Through the process described above, without using astarting bit or an ending bit for specific information (specific syntaxelement) in the bitstream, the corresponding information may be signaledby using variable length bit. Through this, relatively smaller bit maybe allocated for a lower value, and overall coding efficiency may beimproved.

The decoding apparatus may perform entropy decoding based on context ofeach of the bins in the bin string from the bitstream based on theentropy coding technique such as context-adaptive arithmetic coding(CABAC), context-adaptive variable length coding (CAVLC), or the like.In addition, the bitstream may include various types of information forimage/video decoding such as prediction information in addition to theresidual information including the information for the abs_remainder asdescribed above. As described above, the bitstream may be forwarded tothe decoding apparatus through a (digital) storage medium or a network.

Meanwhile, the Rice parameter derivation process may be omitted forsig_coeff_flag, par_level_flag, rem_abs_gt1_flag, rem_abs_gt2_flag, andthe like, which are binarized based on the FL binarization processwithout using the Rice parameter. The binarized based on the FLbinarization process, not the binarization process based on the Riceparameter, may be performed for the sig_coeff_flag, the par_level_flag,the rem_abs_gt1_flag, the rem_abs_gt2_flag, and the like.

Later, the decoding apparatus may perform dequantization and/or inversetransform process of the (quantized) transform coefficients and deriveresidual samples for the current block. Reconstruction samples may begenerated based on the residual samples and prediction samples derivedthrough inter prediction/intra prediction, and a reconstruction pictureincluding the reconstruction samples may be generated, as describedabove.

FIG. 12 illustrates the entropy decoder 310 of the decoding apparatusperforming the residual decoding method. Referring to FIG. 12, theentropy decoder 310 may include a Rice parameter deriver 311, abinarization unit 312 and an entropy decoding processor 313. The Riceparameter derivation process may be performed by the Rice parameterderiver 311 in the entropy decoder 310. In addition, the binarizationprocess may be performed by the binarization unit 312 in the entropydecoder 310. The entropy decoding process may be performed by theentropy decoding processor 313 in the entropy decoder 310.

FIG. 13 illustrates an image encoding method by the encoding apparatusaccording to the present disclosure. The method shown in FIG. 13 may beperformed by the encoding apparatus shown in FIG. 2. Particularly, forexample, step S1300 of FIG. 13 may be performed by the transformerand/or the quantizer of the encoding apparatus, and steps S1310 to S1330may be performed by the entropy encoder of the encoding apparatus. Inaddition, although it is not shown, the process of deriving a predictionsample may be performed by the predictor of the encoding apparatus, theprocess of deriving a residual sample for the current chroma block basedon the original sample and the prediction sample for the current blockmay be performed by the subtractor of the encoding apparatus, and theprocess of a reconstruction sample for the current block based on theresidual samples and the prediction samples for the current block may beperformed by the adder of the encoding apparatus.

The encoding apparatus derives a first residual coefficient and a secondresidual coefficient of the current block (S1300). The encodingapparatus may determine whether to perform inter prediction or performintra prediction for the current block and determine a specific interprediction mode or a specific intra prediction mode based on RD cost.The encoding apparatus may derive prediction samples for the currentblock according to the determined mode and derive the residual samplesthrough subtraction from the original samples and the prediction samplesfor the current block.

Later, the encoding apparatus may determine whether a transform isapplied to the residual samples. In the case that the transform is notapplied to the residual samples, the encoding apparatus may performquantization on the derived residual samples and derive the firstresidual coefficient and the second residual coefficient. In addition,in the case that the transform is applied to the residual samples, theencoding apparatus may derive transformed coefficients by performing thetransform for the derived residual samples and derive the first residualcoefficient and the second residual coefficient by performingquantization for the coefficients.

Meanwhile, the encoding apparatus may generate and encode a transformskip flag that represents whether the transform of the residualcoefficients of the current block is applied. Image information mayinclude the transform skip flag for the current block. The transformskip flag may represent whether the transform of the residualcoefficients of the current block is applied. That is, the transformskip flag may represent whether the transform is applied to the residualcoefficients. The syntax element representing the transform skip flagmay be transform_skip_flag described above.

The encoding apparatus set the Rice parameter for the first residualcoefficient and the second residual coefficient as a specific value(S1310).

The encoding apparatus may set the Rice parameter for the first residualcoefficient and the second residual coefficient as a specific value. Theencoding apparatus may set the Rice parameter for binarization of firstsize related information for the first residual coefficient and secondsize related information for the second residual coefficient as aspecific value. For example, the specific value may be 0, 1, 2, 3, 4 or5.

As an example, the Rice parameter may be set based on the transform skipflag. For example, when the transform skip flag value is 1, the Riceparameter may be set to a specific value. For example, the specificvalue may be 0, 1, 2, 3, 4 or 5. In addition, when the transform skipflag value is 0, the Rice parameter, which is different value, may beset to the residual coefficients of the current block. For example, whenthe transform skip flag value is 0, the Rice parameter for the firstresidual coefficient of the current block may be set to 0, and the Riceparameter for a residual coefficient except the first residualcoefficient may be set (or updated) based on a value of residualcoefficient which is decoded before the residual coefficient.

Alternatively, as another example, the Rice parameter value may be setbased on a size of the current block. As an example, in the case thatthe size of the current block is less than a specific size, the Riceparameter for residual coefficient of the current block may be set tozero, and in the case that the size of the current block is a specificsize or more, the Rice parameter for residual coefficient of the currentblock may be defined as 1. The specific size may be derived as 4×4 size,8×8 size, 16×16 size, 32×32 size, or the like. For example, in the casethat the size of the current block is less than 4×4 size, the Riceparameter for residual coefficient of the current block may be definedas 0, and in the case that the size of the current block is 4×4 size orgreater, the Rice parameter for residual coefficient of the currentblock may be defined as 1.

Alternatively, for example, in the case that the sample number of thecurrent block is less than 256, the Rice parameter for residualcoefficient of the current block may be set to 1, and in the case thatthe sample number of the current block is 256 or more, the Riceparameter for residual coefficient of the current block may be set to 2.Here, the size of the current block may represent the sample number ofthe current block.

Alternatively, as another example, the Rice parameter may be set basedon a ratio between a width and a height of the current block. Forexample, in the case that the ratio between a width and a height of thecurrent block is greater than 2 or less than ½ (i.e., a value of widthdivided by height is greater than 2 or less than ½, the Rice parameterfor residual coefficient of the current block may be set to 0, and inthe case that the ratio between a width and a height of the currentblock is ½ or more and 2 or less (i.e., a value of width divided byheight is ½ or more and 2 or less, the Rice parameter for residualcoefficient of the current block may be set to 1.

Alternatively, as another example, the Rice parameter may be set basedon a component of the current block. That is, the Rice parameter may beset adaptively depending on whether the component of the current blockis a luma component or a chroma component.

The encoding apparatus derives binary values for the first size relatedinformation for the first residual coefficient and the second sizerelated information for the second residual coefficient based on theRice parameter (S1320). The encoding apparatus may derive the binaryvalues based on the binarization process for the size relatedinformation described above.

For example, the encoding apparatus may derive a cMax for the first sizerelated information based on the Rice parameter and Equation 9 describedabove. That is, by substituting the Rice parameter to Equation 9described above, the cMax may be derived. Later, the encoding apparatusmay derive a prefix value (i.e., prefixVal described above) for thefirst size related information based on the cMax and Equation 10 above.That is, by substituting the cMax to Equation 10 described above, theprefix value may be derived. Next, the encoding apparatus may derive aprefix binary value for the first size related information by performingthe truncated Rice binarization process for the prefix value. The prefixbinary value may be referred to as a prefix bin string. Meanwhile, asuffix binary value for the first size related information may bepresent, and in the case that the suffix binary value is present, thebinary value for the size related information may be concatenation ofthe prefix binary value and the suffix binary value. The suffix binaryvalue may be referred to as a suffix bin string. For example, a lengthof the suffix binary value is 4 bits and values of all bits are 1 (i.e.,the case the prefix binary value is 1111), the suffix binary value maybe present. The encoding apparatus may derive the suffix value for thefirst size related information (i.e., suffxVal described above) based onthe cMax and Equation 11 above. That is, by substituting the cMax toEquation 11 described above, the suffix value may be derived. Later, theencoding apparatus may derive the suffix binary value for the first sizerelated information by performing the k-th order Exp-Golomb (EGk)binarization process for the suffix value. Here, k may be set to a valueof the Rice parameter plus 1.

In addition, for example, the encoding apparatus may derive a cMax forthe second size related information based on the Rice parameter andEquation 9 described above. That is, by substituting the Rice parameterto Equation 9 described above, the cMax may be derived. Later, theencoding apparatus may derive a prefix value (i.e., prefixVal describedabove) for the second size related information based on the cMax andEquation 10 above. That is, by substituting the cMax to Equation 10described above, the prefix value may be derived. Next, the encodingapparatus may derive a prefix binary value for the second size relatedinformation by performing the truncated Rice binarization process forthe prefix value. The prefix binary value may be referred to as a prefixbin string. Meanwhile, a suffix binary value for the second size relatedinformation may be present, and in the case that the suffix binary valueis present, the binary value for the size related information may beconcatenation of the prefix binary value and the suffix binary value.The suffix binary value may be referred to as a suffix bin string. Forexample, a length of the suffix binary value is 4 bits and values of allbits are 1 (i.e., the case the prefix binary value is 1111), the suffixbinary value may be present. The encoding apparatus may derive thesuffix value for the second size related information (i.e., suffxValdescribed above) based on the cMax and Equation 11 above. That is, bysubstituting the cMax to Equation 11 described above, the suffix valuemay be derived. Later, the encoding apparatus may derive the suffixbinary value for the second size related information by performing thek-th order Exp-Golomb (EGk) binarization process for the suffix value.Here, k may be set to a value of the Rice parameter plus 1.

The encoding apparatus performs entropy encoding of the binary value ofthe first size related information and the binary value of the secondsize related information and generates residual information includingthe first size related information and the second size relatedinformation (S1330).

The encoding apparatus may perform entropy encoding of the binary valueof the first size related information and the binary value of the secondsize related information and derive the first size related informationand the second size related information. For example, encoding apparatusmay perform bypass encoding of the binary value of the first sizerelated information and the binary value of the second size relatedinformation and derive the binary value of the first size relatedinformation and the binary value of the second size related information.That is, the encoding apparatus may encode by applying uniformprobability distribution to the bin constructing the binary values ofthe first size related information and encode by applying uniformprobability distribution to the bin constructing the binary values ofthe second size related information. The syntax element representing thefirst size related information and the second size related informationmay be the abs_remainder described above.

In addition, for example, the residual information may includeinformation indicating a position of the last non-zero residualcoefficient of the current block. The non-zero residual coefficient mayalso be referred to as a valid coefficient. The information may indicatethe position of the last non-zero residual coefficient in the residualcoefficient array of the current block. The syntax element indicatingthe information of the last non-zero residual coefficient may belast_sig_coeff_x_prefix, last_sig_coeff_y_prefix,last_sig_coeff_x_suffix and last_sig_coeff_y_suffix.

Furthermore, for example, the residual information may includeinformation for the residual coefficient. For example, the syntaxelement indicating the information may be sig_coeff_flag,par_level_flag, rem_abs_gt1_flag, and/or rem_abs_gt2_flag, describedabove.

In addition, for example, the residual information may include thetransform skip flag for the current block. The transform skip flag mayrepresent whether the transform of the residual coefficients of thecurrent block is applied. That is, the transform skip flag may representwhether the transform is applied to the residual coefficients. Thesyntax element representing the transform skip flag may betransform_skip_flag described above.

The encoding apparatus may transmit image information including theresidual information. The image information may be output in a bitstreamformat. Here, for example, the image information may include predictioninformation for the current block. The prediction information mayinclude information for inter prediction or intra prediction performedin the current block. For example, the prediction information may beinformation related to the prediction process and include predictionmode information and information related to motion information (e.g., inthe case that inter prediction is applied).

Meanwhile, the bitstream may be transmitted to the decoding apparatusthrough a network or a (digital) storage medium. Here, the network mayinclude a broadcasting network and/or a communication network, and thedigital storage medium may include various storage media such as USB,SD, CD, DVD, Blu-ray, HDD, SSD, and the like.

FIG. 14 schematically illustrates the encoding apparatus performing theimage encoding method according to the present disclosure. The methodshown in FIG. 13 may be performed by the encoding apparatus shown inFIG. 14. Particularly, for example, the subtractor of the encodingapparatus of FIG. 14 may perform step S1300 of FIG. 13, and the entropyencoder of the encoding apparatus of FIG. 14 may perform steps S1310 toS1330 of FIG. 13. In addition, although it is not shown, the process ofderiving a prediction sample may be performed by the predictor of theencoding apparatus.

FIG. 15 schematically illustrates the image decoding method of thedecoding apparatus according to the present disclosure. The method shownin FIG. 15 may be performed by the decoding apparatus shown in FIG. 3.Particularly, for example, steps S1500 to S1550 of FIG. 15 may beperformed by the entropy decoder of the decoding apparatus, and stepS1560 may be performed by the adder of the decoding apparatus. Inaddition, although it is not shown, the process of deriving a predictionsample may be performed by the predictor of the decoding apparatus.

The decoding apparatus receives residual information including firstsize related information for a first residual coefficient and secondsize related information for a second residual coefficient (S1500). Thedecoding apparatus may receive image information including the residualinformation for the current block through a bitstream. Here, the currentblock may be a Coding Block (CB) or a Transform Block (TB).

For example, the residual information may include the first size relatedinformation for the first residual coefficient and the second sizerelated information for the second residual coefficient. The syntaxelement representing the first size related information and the secondsize related information may be the abs remainder described above.

In addition, for example, the residual information may includeinformation indicating a position of the last non-zero residualcoefficient of the current block. The non-zero residual coefficient mayalso be referred to as a valid coefficient. The information may indicatethe position of the last non-zero residual coefficient in the residualcoefficient array of the current block. The syntax element indicatingthe information of the last non-zero residual coefficient may belast_sig_coeff_x_prefix, last_sig_coeff_y_prefix,last_sig_coeff_x_suffix and last_sig_coeff_y_suffix.

Furthermore, for example, the residual information may includeinformation for the residual coefficient. For example, the syntaxelement indicating the information may be sig_coeff_flag,par_level_flag, rem_abs_gt1_flag, and/or rem_abs_gt2_flag, describedabove.

In addition, for example, the image information may include thetransform skip flag for the current block. The transform skip flag mayrepresent whether the transform of the residual coefficients of thecurrent block is applied. That is, the transform skip flag may representwhether the transform is applied to the residual coefficients. Thesyntax element representing the transform skip flag may betransform_skip_flag described above. When the transform skip flag valuefor the current block is 1, the decoding apparatus may derive residualcoefficients based on the received residual information and derive thederived residual coefficients as residual samples. Alternatively, whenthe transform skip flag value for the current block is 0, the decodingapparatus may derive residual coefficients based on the receivedresidual information and derive residual samples by inverse-transformingthe derived coefficients.

Meanwhile, the image information may include prediction information forthe current block. The prediction information may include informationfor inter prediction or intra prediction performed in the current block.The decoding apparatus may perform inter prediction or intra predictionfor the current block based on the prediction information receivedthrough the bitstream and derive prediction samples of the currentblock.

The decoding apparatus set the Rice parameter of the first size relatedinformation and the second size related information as a specific value(S1510). The decoding apparatus may set the Rice parameter of the firstsize related information and the second size related information as aspecific value. The decoding apparatus may set the Rice parameter forbinarization of the first size related information and the second sizerelated information as a specific value. For example, the specific valuemay be 0, 1, 2, 3, 4 or 5.

As an example, the Rice parameter may be set based on the transform skipflag. For example, when the transform skip flag value is 1, the Riceparameter may be set to a specific value. For example, the specificvalue may be 0, 1, 2, 3, 4 or 5. In addition, when the transform skipflag value is 0, the Rice parameter, which is different value, may beset to the residual coefficients of the current block. For example, whenthe transform skip flag value is 0, the Rice parameter for the firstresidual coefficient of the current block may be set to 0, and the Riceparameter for a residual coefficient except the first residualcoefficient may be set (or updated) based on a value of residualcoefficient which is decoded before the residual coefficient.

Alternatively, as another example, the Rice parameter value may be setbased on a size of the current block. As an example, in the case thatthe size of the current block is less than a specific size, the Riceparameter for residual coefficient of the current block may be set tozero, and in the case that the size of the current block is a specificsize or more, the Rice parameter for residual coefficient of the currentblock may be defined as 1. The specific size may be derived as 4×4 size,8×8 size, 16×16 size, 32×32 size, or the like. For example, in the casethat the size of the current block is less than 4×4 size, the Riceparameter for residual coefficient of the current block may be definedas 0, and in the case that the size of the current block is 4×4 size orgreater, the Rice parameter for residual coefficient of the currentblock may be defined as 1.

Alternatively, for example, in the case that the sample number of thecurrent block is less than 256, the Rice parameter for residualcoefficient of the current block may be set to 1, and in the case thatthe sample number of the current block is 256 or more, the Riceparameter for residual coefficient of the current block may be set to 2.Here, the size of the current block may represent the sample number ofthe current block.

Alternatively, as another example, the Rice parameter may be set basedon a ratio between a width and a height of the current block. Forexample, in the case that the ratio between a width and a height of thecurrent block is greater than 2 or less than ½ (i.e., a value of widthdivided by height is greater than 2 or less than ½, the Rice parameterfor residual coefficient of the current block may be set to 0, and inthe case that the ratio between a width and a height of the currentblock is ½ or more and 2 or less (i.e., a value of width divided byheight is ½ or more and 2 or less, the Rice parameter for residualcoefficient of the current block may be set to 1.

Alternatively, as another example, the Rice parameter may be set basedon a component of the current block. That is, the Rice parameter may beset adaptively depending on whether the component of the current blockis a luma component or a chroma component.

The decoding apparatus derives available binary values for the firstsize related information and the second size related information basedon the Rice parameter (S1520). The decoding apparatus may derive theavailable binary values based on the binarization process for the sizerelated information. For example, the decoding apparatus may derive acMax for the first size related information based on the Rice parameterand Equation 9 described above. That is, by substituting the Riceparameter to Equation 9 described above, the cMax may be derived. Later,the decoding apparatus may derive a prefix value (i.e., prefixValdescribed above) for the size related information based on the cMax andEquation 10 above. That is, by substituting the cMax to Equation 10described above, the prefix value may be derived. Next, the decodingapparatus may derive a prefix binary value for the size relatedinformation by performing the truncated Rice binarization process forthe prefix value. The prefix binary value may be referred to as a prefixbin string. Meanwhile, a suffix binary value for the size relatedinformation may be present, and in the case that the suffix binary valueis present, the binary value for the size related information may beconcatenation of the prefix binary value and the suffix binary value.The suffix binary value may be referred to as a suffix bin string. Forexample, a length of the suffix binary value is 4 bits and values of allbits are 1 (i.e., the case the prefix binary value is 1111), the suffixbinary value may be present. The decoding apparatus may derive thesuffix value for the size related information (i.e., suffxVal describedabove) based on the cMax and Equation 11 above. That is, by substitutingthe cMax to Equation 11 described above, the suffix value may bederived. Later, the decoding apparatus may derive the suffix binaryvalue for the size related information by performing the k-th orderExp-Golomb (EGk) binarization process for the suffix value. Here, k maybe set to a value of the Rice parameter plus 1.

The decoding apparatus derives the binary value of the first sizerelated information and the binary value of the second size relatedinformation by decoding the first size related information and thesecond size related information (S1530). The decoding apparatus mayderive the binary value (i.e., bin string) of the first size relatedinformation by parsing the bin for the first size related informationand derive the binary value (i.e., bin string) of the second sizerelated information by parsing the bin for the second size relatedinformation.

The decoding apparatus may perform entropy decoding of the first sizerelated information and the second size related information and derivethe binary value of the first size related information and the binaryvalue of the second size related information. For example, decodingapparatus may perform bypass decoding of the binary value of the firstsize related information and the binary value of the second size relatedinformation and derive the binary value of the first size relatedinformation and the binary value of the second size related information.That is, the decoding apparatus may decode by applying uniformprobability distribution to the bin for the first size relatedinformation received through the bitstream and decode by applyinguniform probability distribution to the bin for the second size relatedinformation received through the bitstream.

The decoding apparatus derives values of the first size relatedinformation and the second size related information by comparing thebinary values and the available binary values (S1540). The decodingapparatus may derive values of the first size related information andthe second size related information by comparing the binary values andthe available binary values. For example, the decoding apparatus maycompare the binary value of the first size related information and theavailable binary values, and in the case that the binary value of thefirst size related information is identical to a specific binary valuewhich is one of the available binary values, the decoding apparatus mayderive the value for the specific binary value as the value of the firstsize related information. In addition, decoding apparatus may comparethe binary value of the second size related information and theavailable binary values, and in the case that the binary value of thesecond size related information is identical to a specific binary valuewhich is one of the available binary values, the decoding apparatus mayderive the value for the specific binary value as the value of thesecond size related information.

The decoding apparatus derives the first residual coefficient and thesecond residual coefficient based on the values of the first sizerelated information and the second size related information (S1550). Forexample, when the transform skip flag value for the current block is 1,the decoding apparatus may derive the first residual coefficient and thesecond residual coefficient based on the values of the first sizerelated information and the second size related information.

The decoding apparatus reconstructs the current picture based on thefirst residual coefficient and the second residual coefficient (S1560).The decoding apparatus may derive the residual samples for the currentblock based on the first residual coefficient and the second residualcoefficient. For example, when the transform skip flag value for thecurrent block is 1, the decoding apparatus may derive the residualsamples by performing dequantization for the derived residualcoefficients. Alternatively, when the transform skip flag value for thecurrent block is 0, the decoding apparatus may perform dequantizationfor the derived residual coefficients and derive the residual samples byinverse-transforming the dequantized coefficients. In addition, thedecoding apparatus may perform inter prediction or intra prediction forthe current block based on the prediction information received through abitstream and derive prediction samples and generate the reconstructionpicture through addition of the prediction samples and the residualsamples. Later, as occasion demands, in order to improvesubjective/objective image quality, the in-loop filtering process suchas deblocking filtering, SAO and/or ALF process may be applied to thereconstruction picture as described above.

FIG. 16 schematically illustrates the decoding apparatus performing theimage decoding method according to the present disclosure. The methodshown in FIG. 15 may be performed by the decoding apparatus shown inFIG. 16. Particularly, for example, the entropy decoder of the decodingapparatus of FIG. 16 may perform steps S1500 to S1550 of FIG. 15, andthe adder of the decoding apparatus of FIG. 16 may perform step S1560 ofFIG. 15. In addition, although it is not shown, the process of derivinga prediction sample may be performed by the predictor of the decodingapparatus of FIG. 16.

According to the present disclosure, efficiency of residual coding maybe improved.

In addition, according to the present disclosure, by considering thatthere is little correlation among residual coefficients of a pixeldomain in which transform process is not performed, the process ofderiving a rice parameter for binarizing residual coefficients may besimplified, and through this, residual coding efficiency may beimproved.

The residual coefficients to which transform is not applied, differentfrom the fact that the residual coefficients in a transform domain towhich transform is applied have high correlation, may have insufficientcorrelation. Accordingly, in such a case, instead of deriving the Riceparameter for binarization based on a residual coefficient previouslydecoded, setting the Rice parameter as a fixed specific value, which maytransmit information for the residual coefficients more efficiently.

In the above-described embodiment, the methods are described based onthe flowchart having a series of steps or blocks. The present disclosureis not limited to the order of the above steps or blocks. Some steps orblocks may occur simultaneously or in a different order from other stepsor blocks as described above. Further, those skilled in the art willunderstand that the steps shown in the above flowchart are notexclusive, that further steps may be included, or that one or more stepsin the flowchart may be deleted without affecting the scope of thepresent disclosure.

The embodiments described in the present disclosure may be implementedand performed on a processor, a micro-processor, a controller or a chip.For example, functional units shown in each Figure may be implementedand performed on a computer, a processor, a micro-processor, acontroller or a chip. In this case, information (ex. information oninstructions) for implementation or algorithm may be stored in a digitalstorage medium.

In addition, the decoding apparatus and the encoding apparatus to whichthe embodiments of the present disclosure are applied may be included ina multimedia broadcasting transmission/reception apparatus, a mobilecommunication terminal, a home cinema video apparatus, a digital cinemavideo apparatus, a surveillance camera, a video chatting apparatus, areal-time communication apparatus such as video communication, a mobilestreaming apparatus, a storage medium, a camcorder, a VoD serviceproviding apparatus, an Over the top (OTT) video apparatus, an Internetstreaming service providing apparatus, a three-dimensional (3D) videoapparatus, a teleconference video apparatus, a vehicle means terminal(e.g., vehicle terminal, airplane terminal, ship terminal, etc.) and amedical video apparatus and may be used to process video signals anddata signals. For example, the OTT video apparatus may include a gameconsole, a blu-ray player, an internet access TV, a home theater system,a smartphone, a tablet PC, a Digital Video Recorder (DVR), and the like.

Furthermore, the processing method to which the embodiments of thepresent disclosure are applied may be produced in the form of a programthat is to be executed by a computer and may be stored in acomputer-readable recording medium. Multimedia data having a datastructure according to the present disclosure may also be stored incomputer-readable recording media. The computer-readable recording mediainclude all types of storage devices in which data readable by acomputer system is stored. The computer-readable recording media mayinclude a BD, a Universal Serial Bus (USB), ROM, RAM, CD-ROM, a magnetictape, a floppy disk, and an optical data storage device, for example.Furthermore, the computer-readable recording media includes mediaimplemented in the form of carrier waves (e.g., transmission through theInternet). Furthermore, a bit stream generated by the encoding methodmay be stored in a computer-readable recording medium or may betransmitted over wired/wireless communication networks.

In addition, the embodiment of the present disclosure may be implementedwith a computer program product by program codes, and the program codesmay be performed in a computer by the embodiment of the presentdisclosure. The program codes may be stored on a carrier readable by acomputer.

FIG. 17 illustrates a structure diagram of a content streaming system towhich the embodiments of the present disclosure are applied.

The content streaming system to which the embodiments of the presentdisclosure are applied may largely include an encoding server, astreaming server, a web server, a media storage, a user device, and amultimedia input device.

The encoding server compresses contents input from multimedia inputdevices including a smartphone, a camera, a camcorder, and the like,into digital data to serve to generate the bitstream and transmit thebitstream to the streaming server. As another example, when themultimedia input devices including the smartphone, the camera, thecamcorder, and the like directly generate the bitstream, the encodingserver may be omitted.

The bitstream may be generated by the encoding method or the bitstreamgenerating method to which the embodiments of the present disclosure areapplied, and the streaming server may temporarily store the bitstream inthe process of transmitting or receiving the bitstream.

The streaming server transmits multimedia data to the user device basedon a user request through a web server, and the web server serves as anintermediary for informing a user of what service there is. When theuser requests a desired service to the web server, the web servertransfers the requested service to the streaming server and thestreaming server transmits the multimedia data to the user. In thiscase, the content streaming system may include a separate controlserver, and in this case, the control server serves to control acommand/response between respective devices in the content streamingsystem.

The streaming server may receive contents from the media storage and/orthe encoding server. For example, when the streaming server receives thecontents from the encoding server, the streaming server may receive thecontents in real time. In this case, the streaming server may store thebitstream for a predetermined time in order to provide a smoothstreaming service.

Examples of the user device may include a cellular phone, a smart phone,a laptop computer, a digital broadcasting terminal, a personal digitalassistants (PDA), a portable multimedia player (PMP), a navigation, aslate PC, a tablet PC, an ultrabook, a wearable device such as asmartwatch, a smart glass, or a head mounted display (HMD), a digitalTv, a desktop computer, digital signage, and the like. Each server inthe content streaming system may be operated as a distributed server,and in this case, data received by each server may be processed indistributed manner.

What is claimed is:
 1. A method for image decoding performed by adecoding apparatus, the method comprising: receiving residualinformation including first size related information for a firstresidual coefficient and second size related information for a secondresidual coefficient of a current block; setting a Rice parameter of thefirst size related information and the second size related informationas a specific value; deriving available binary values for the first sizerelated information and the second size related information based on theRice parameter; deriving a binary value of the first size relatedinformation and a binary value of the second size related information bydecoding the first size related information and the second size relatedinformation; deriving values of the first size related information andthe second size related information by comparing the binary values andthe available binary values; deriving the first residual coefficient andthe second residual coefficient based on the values of the first sizerelated information and the second size related information; andreconstructing a current picture based on the first residual coefficientand the second residual coefficient.
 2. The method of claim 1, whereinthe residual information includes a transform skip flag for the currentblock, wherein the transform skip flag represents whether to applytransform of residual coefficients, and wherein the Rice parameter isset based on the transform skip flag.
 3. The method of claim 2, whereinwhen a value of the transform skip flag is 1, wherein the Rice parameterof the first size related information and the second size relatedinformation is set to the specific value.
 4. The method of claim 1,wherein the specific value is
 1. 5. The method of claim 1, wherein thespecific value is one of 2, 3, 4 and
 5. 6. The method of claim 1,wherein the Rice parameter is set based on a size of the current block.7. The method of claim 6, wherein when a size of the current block isless than a specific size, wherein the Rice parameter is set to 0, andwhen the size of the current block is greater than or equal to thespecific size, wherein the Rice parameter for residual coefficients ofthe current block is set to
 1. 8. The method of claim 6, wherein when asample number of the current block is less than 256, wherein the Riceparameter is set to 1, and when a sample number of the current block isgreater than or equal to 256, wherein the Rice parameter is set to
 2. 9.The method of claim 1, wherein the Rice parameter is set based on aratio between a width and a height of the current block.
 10. The methodof claim 9, when the ratio between the width and the height of thecurrent block is greater than 2 and less than ½, wherein the Riceparameter is set to 0, and when the ratio between the width and theheight of the current block is ½ or more and 2 or less, wherein the Riceparameter is set to
 1. 11. A method for image encoding performed by anencoding apparatus, the method comprising: deriving a first residualcoefficient and a second residual coefficient of a current block;setting a Rice parameter for the first residual coefficient and thesecond residual coefficient as a specific value; deriving binary valuesfor first size related information for the first residual coefficientand second size related information for the second residual coefficientbased on the Rice parameter; and generating residual informationincluding the first size related information and the second size relatedinformation by encoding the binary values for the first size relatedinformation and the second size related information.
 12. The method ofclaim 11, wherein the residual information includes a transform skipflag for the current block, wherein the transform skip flag representswhether to apply transform of residual coefficients, and wherein theRice parameter is set based on the transform skip flag.
 13. The methodof claim 12, wherein when a value of the transform skip flag is 1, theRice parameter of the first size related information and the second sizerelated information is set to the specific value.
 14. The method ofclaim 11, wherein the specific value is
 1. 15. The method of claim 11,wherein the specific value is one of 2, 3, 4 and 5.